Arrays in Rev

Gordon gwalias-rev at yahoo.com
Fri Dec 10 15:39:50 EST 2004


Dear Revolutionaries

Thanks for all the suggestions - I appreciate the
help.

I have to say that I agree with Troy - it seems like
rr could really use some kind of elegant solution to
this problem. Sure - it's possible to work around it,
but having to code these kind of basic housekeeping
functions introduces more room for the unexpected to
occur and ultimately makes rr less robust if you have
to rely on a bunch of extra code to do something that
could be innate in the language.

IMHO, the single greatest feature in the Python
language is the nestable keyed libraries that can be
freely mixed with lists. How beautiful, simple,
elegant and still readable ten years later it is, when
you can use something like:

for client in myBusiness["clients"]["european"]:
   if client["city"] == "Munich":
       dataBase["My Munich Clients"].append(client)

I would vote for something like this in rr :)

Best

Gordon


--- Troy Rollins <troy at rpsystems.net> wrote:

> 
> On Dec 10, 2004, at 2:44 PM, Alex Tweedly wrote:
> 
> > It's "real", but it is NOT *within* another array.
> > In Rev, you cannot do something equivalent to
> >
> > put "abc" into a[1]
> > put  "def" into a[2]
> >
> > put "ghi" into b["z"]
> > put a into b["y"]
> >
> > which you can (with different syntax) in Perl,
> Python, (I think) Ruby, 
> > ....
> 
> Or in Lingo -
> 
> myVar = [#check: [#this: [#out: "Cool"]]]
> 
> put myVar.check.this.out
> -- "Cool"
> 
> put myVar[1][1][1]
> -- "Cool"
> 
> People will debate the usefulness of such
> constructs, but I have yet to 
> see anything in Transcript which is nearly so
> elegant for complex 
> iterative evaluations. I strongly believe that
> Transcript needs this 
> type of data structuring... but then of course, I
> don't let go easily 
> to what I've learned and switch to what some Rev
> users would consider 
> more "native" data management techniques which *are*
> available, though 
> *much* more "wordy" to get there, and certainly do
> not iterate as 
> elegantly.
> --
> Troy
> RPSystems, Ltd.
> http://www.rpsystems.net
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
>
http://lists.runrev.com/mailman/listinfo/use-revolution
> 


=====
:::::::::: Gordon Webster ::::::::::


More information about the use-livecode mailing list