|
Yes, but in javascript it is dynamic and we also have tre different type of
copys:
Referential copy:
myNewObject = myObject
anything you do in myNewObject will also affect myObject even if
myNewObject is only a part of myObject like
myNewObject = myObject[1]
Shallow copy
myJSON = JSON.stringify(myObject)
myNewObject = JSON.parse(myJSON)
There is no reference between myNewObejct and myObject however any
functions aint copied since JSON don support datatype function.
Deep Copy
myNewObject = new myObject
There is no reference between myNewObject and myObject and myNewObject will
be a exact copy of myObject.
On Wed, Jul 5, 2017 at 5:53 PM, jacobus erps <jacobus.erps@xxxxxxxxx>
wrote:
Henrik, now you got me...sort
However, one of the supported types is "pointer".
And now i'm thinking of it (thanks) i need to support not only "pointer"
but also "procedure pointer".
JavaScript is very flexible and mallable, no contest there.
Functions as first-class citizens, i know.
On Wed, Jul 5, 2017 at 5:49 PM, Henrik Rützou <hr@xxxxxxxxxxxx> wrote:
Until you reach parm5 where you inject a function into the object;-)
myObject[1].parm5 = function(msg) { alert(msg) }
and execute it
myObject[1].parm5("Hello Jacobus")
On Wed, Jul 5, 2017 at 5:20 PM, jacobus erps <jacobus.erps@xxxxxxxxx>
wrote:
Henrik,
With the map impl. i'm about to release you can do the same (well
wrote:of):
they
Create the map:
map = rm_m(
rm_a('parm1') : rm_v( rm_i(1) : rm_i(2) : rm_i(3) ) :
rm_a('parm2') : rm_v( rm_i(4) : rm_i(5) : rm_i(6) ) );
This map has as key "parm1" with a list (vector) containing 1, 2, 3;
Now i add 4 to this list
rm_ins( rm__a(map:'parm1') : rm_i(4) : rm_i(4) );
rm_v actually creates a special map, where the keys are implied (i.e.
keys will automatically become 1,2,3 etc).
On Wed, Jul 5, 2017 at 5:01 PM, Henrik Rützou <hr@xxxxxxxxxxxx>
completelyelements
When you talk about dynamic array's in rpg you talk about no. of
not as in javascript
where you may define a array within an array or an object
underpublicized,involved!dynamicalmyObject
myObject = [
{ parm1 : "aaa", parm2 : [1,2,3,4] },
{ parm1 : "bbb", parm2 : [5,6,7,8] }
]
and then add parm3 and parm4 to the obejct in array element 1 in
myObject[1].parm3 = "tralala"
myObject[1].parm4 = ["a","b","c"]
Try to do that in RPG and remember there is no dcl statements
gallium.arsenide@xxxxxxxxx
On Wed, Jul 5, 2017 at 4:37 PM, John Yeung <
jacobus.erps@xxxxxxxxx
wrote:
[Cross-posted to RPG400-L and OPENSOURCE]
On Wed, Jul 5, 2017 at 9:39 AM, jacobus erps <
wrote:
What RPG misses is a vibrant eco system.
There are no standard libraries to speak of.
Lack of dynamic datastructures, like maps.
I certainly agree on the lack of standard libraries. I would
characterize RPG's ecosystem this way: Fledgling,
It'sgrowing. I agree it's not "vibrant" yet, but that may change.
RPG.someonedefinitely going in the direction of vibrancy.
There was a recent mini-flurry of Stack Overflow questions by
who has been working on their own dynamic data structures for
here:(You're not that someone, are you?) Their results so far are
from
<https://github.com/lppedd/RPG>
Dynamic arrays for RPG have been available for many years now
atnot
least Mihael Schmidt and Aaron Bartell, perhaps also others I'm
RPG,aware of. (As I said, underpublicized.)
I'm currently working on a versatile map implementation for
anotherhopeHashMap
(integer,to
release it soon as an open source project.
The map may contain any combination of key/item data types
packed
decimal, date, etc), iteration is done through cursors with
setll/setgt/read/readp/reade semantics.
The keys and items in a map maybe other maps too.
The Stack Overflow activity I mentioned above culminated in a
fromdescribedimplementation. I'm not sure it's as flexible as what you've
Java's(allow a map to be a key?), but it ought to work very much like
doesn'tHashMap.
I'm not too familiar with Java actually, but I know Python pretty
well, and its built-in mapping structure (called "dictionary")
allow keys to be mutable. Among other things, this prevents you
inadvertently mutating one key so that it becomes equal to
affiliateleastkey.
If you're not LppEdd (Edoardo Luppi), you probably ought to at
relevantcheck out what they've already done. For reference, the most
affiliateaffiliate(RPG400-L)Stack Overflow question was this:
<https://stackoverflow.com/questions/44461953/hashmap-implem
entation-rpgle>
John Y.
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
(RPG400-L)link: http://amzn.to/2dEadiD
--
Regards,
Henrik Rützou
http://powerEXT.com <http://powerext.com/>
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
(RPG400-L)link: http://amzn.to/2dEadiD--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
(RPG400-L)link: http://amzn.to/2dEadiD
--
Regards,
Henrik Rützou
http://powerEXT.com <http://powerext.com/>
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
mailing list--
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
Regards,
Henrik Rützou
http://powerEXT.com <http://powerext.com/>
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.