Re: Keys of a custom property array

2013-03-04 Thread Monte Goulding
On 05/03/2013, at 11:40 AM, Richard Gaskin wrote: > > encode as JSON | XML | btree | > > Gets my vote. > > Will you be writing that this week? :) Er... no, I'm busy until the refactoring is done... -- M E R Goulding Software development services Bespoke application development for vert

Re: Keys of a custom property array

2013-03-04 Thread Mark Wieder
Monte- Monday, March 4, 2013, 4:36:43 PM, you wrote: > encode as JSON | XML | btree | Where's that "like" button? -- -Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to sub

Re: Keys of a custom property array

2013-03-04 Thread Richard Gaskin
Monte Goulding wrote: > Hmm... I think your test methods might need to include loading the > stackfile into memory otherwise you are comparing data in memory > with reading data from disk... Since it's not possible to access any part of a stack without loading it into memory, I've only tested on

Re: Keys of a custom property array

2013-03-04 Thread Monte Goulding
On 05/03/2013, at 10:56 AM, Richard Gaskin wrote: > > I agree it makes total sense to use the same format when > > reading/writing to disk. As all the data is loaded into memory anyway > > I wonder how much extra time it would take to turn it into a pointer > > that was just as fast to access as

Re: Keys of a custom property array

2013-03-04 Thread Richard Gaskin
Monte Goulding wrote: > I agree it makes total sense to use the same format when > reading/writing to disk. As all the data is loaded into memory anyway > I wonder how much extra time it would take to turn it into a pointer > that was just as fast to access as a regular array perhaps that > c

Re: Keys of a custom property array

2013-03-04 Thread Monte Goulding
On 05/03/2013, at 9:49 AM, Richard Gaskin wrote: > Mark's notes there describe a future challenge for the parser, but don't > address the current storage format of arrays in custom props. > > Try this: > > Set the value of a custom property to an array, and save that stack. > > Write out a bi

Re: Keys of a custom property array

2013-03-04 Thread Richard Gaskin
Monte Goulding wrote: On 05/03/2013, at 7:47 AM, Richard Gaskin wrote: If you want to store an array as the value of a custom property, I believe that the array is stored in the same format you'd get if you ran the array through arrayEncode. This hasn't been confirmed by RunRev, or even rigo

Re: Keys of a custom property array

2013-03-04 Thread Monte Goulding
On 05/03/2013, at 7:47 AM, Richard Gaskin wrote: > If you want to store an array as the value of a custom property, I believe > that the array is stored in the same format you'd get if you ran the array > through arrayEncode. > > This hasn't been confirmed by RunRev, or even rigorously tested

Re: Keys of a custom property array

2013-03-04 Thread Richard Gaskin
Peter Haworth wrote: Richard, I think your explanation of how arrays stored in cprops are translated back and forth between internal and external storage explains the the performance differences in Mark's tests. I am curious though about your comment on storing multi-dimensional arrays in cProps

Re: Keys of a custom property array

2013-03-04 Thread Dave Cragg
On 4 Mar 2013, at 16:08, Robert Brenstein wrote: > On 04.03.2013 at 14:21 Uhr + Dave Cragg apparently wrote: >> But does that make sense for the following: >> >> delete url >> put x into url >> post x to url >> >> It's hard to think of it as a function in these cases. >> >> Dave > > U

Re: Keys of a custom property array

2013-03-04 Thread Peter Haworth
I'm longing for the day when Google hangouts include the ability to share Scotch! On Sun, Mar 3, 2013 at 7:23 PM, Mark Wieder wrote: > but that could be because I've > been working on a bottle of Laphroaig > Pete lcSQL Software __

Re: Keys of a custom property array

2013-03-04 Thread Robert Brenstein
On 04.03.2013 at 14:21 Uhr + Dave Cragg apparently wrote: But does that make sense for the following: delete url put x into url post x to url It's hard to think of it as a function in these cases. Dave Unless you think of it as a pointer to a container. Robert __

Re: Keys of a custom property array

2013-03-04 Thread Mark Wieder
Dave- Monday, March 4, 2013, 6:21:06 AM, you wrote: > It's hard to think of it as a function in these cases. I'm starting to see why it's classed as a "keyword". -- -Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list use-livecode@lis

Re: Keys of a custom property array

2013-03-04 Thread Dave Cragg
On 4 Mar 2013, at 05:01, Mark Wieder wrote: > It makes much more > sense to ignore the misleading documentation and think of it as a > function. > > put url("file:xyz") But does that make sense for the following: delete url put x into url post x to url It's hard to think of it as a functi

Re: Keys of a custom property array

2013-03-04 Thread Björnke von Gierke
URL is not a function. The reason why it's very often used with parentheses is because of evaluation ordering being unhelpful. There used to be a little popup in the old 1.1.1 documentation that explained operator order, and included containers and keywords. Consider these two statement: put U

Re: Keys of a custom property array

2013-03-03 Thread J. Landman Gay
On 3/3/13 11:23 PM, Mark Wieder wrote: I can't at the moment think of how to run a test that separates these things, but that could be because I've been working on a bottle of Laphroaig and I'm not about to do anything with my computer right now other than send out silly emails. Please continue

Re: Keys of a custom property array

2013-03-03 Thread J. Landman Gay
On 3/3/13 9:37 PM, Monte Goulding wrote: On 04/03/2013, at 2:21 PM, Mark Wieder wrote: If you're in the right folder you can: put url "file:index.html" into tHTML Yes, but that's one of those cases where LC "helps" you along even though you're doing wrong. I don't think so... It's document

Re: Keys of a custom property array

2013-03-03 Thread Monte Goulding
On 04/03/2013, at 4:01 PM, Mark Wieder wrote: > Hmmm... no. > > If we're not going to treat "url" as a function, then in the statement > > put url "file:xyz" > > url is a container, as in > > "put the contents of the url whose reference is file:xyz" > > and in that case, "file:xyz" is the qu

Re: Keys of a custom property array

2013-03-03 Thread Mark Wieder
Pete- Sunday, March 3, 2013, 7:56:53 PM, you wrote: > Richard, > I think your explanation of how arrays stored in cprops are translated back > and forth between internal and external storage explains the the > performance differences in Mark's tests. Jacque's tests actually, not mine. I just sug

Re: Keys of a custom property array

2013-03-03 Thread Monte Goulding
On 04/03/2013, at 2:55 PM, Mark Wieder wrote: >> I don't think so... It's documented as a keyword not a function. > > OK. That stopped me in my tracks. In that case, the syntax is weirder > than I previously thought. It *should* IMO be documented as a > function, but I see all the way back to th

Re: Keys of a custom property array

2013-03-03 Thread Mark Wieder
Monte- Sunday, March 3, 2013, 8:47:42 PM, you wrote: > On 04/03/2013, at 2:36 PM, Richard Gaskin wrote: >> > It's documented as a keyword not a function. >> >> "Keyword" is the "Miscellaneous" of programming languages, the >> box things wind up in when they don't fit into a language's >> equiv

Re: Keys of a custom property array

2013-03-03 Thread Monte Goulding
On 04/03/2013, at 2:36 PM, Richard Gaskin wrote: > > It's documented as a keyword not a function. > > "Keyword" is the "Miscellaneous" of programming languages, the box things > wind up in when they don't fit into a language's equivalent of The Seven > Parts of Speech. ;) Isn't it an adjectiv

Re: Keys of a custom property array

2013-03-03 Thread Peter Haworth
Richard, I think your explanation of how arrays stored in cprops are translated back and forth between internal and external storage explains the the performance differences in Mark's tests. I am curious though about your comment on storing multi-dimensional arrays in cProps. Are you saying it's

Re: Keys of a custom property array

2013-03-03 Thread Mark Wieder
Monte- Sunday, March 3, 2013, 7:37:10 PM, you wrote: > On 04/03/2013, at 2:21 PM, Mark Wieder wrote: >>> If you're in the right folder you can: >>> put url "file:index.html" into tHTML >> >> Yes, but that's one of those cases where LC "helps" you along even >> though you're doing wrong. > I d

Re: Keys of a custom property array

2013-03-03 Thread Richard Gaskin
Monte Goulding wrote: > It's documented as a keyword not a function. "Keyword" is the "Miscellaneous" of programming languages, the box things wind up in when they don't fit into a language's equivalent of The Seven Parts of Speech. ;) -- Richard Gaskin Fourth World Systems Software Desig

Re: Keys of a custom property array

2013-03-03 Thread Monte Goulding
On 04/03/2013, at 2:21 PM, Mark Wieder wrote: >> If you're in the right folder you can: >> put url "file:index.html" into tHTML > > Yes, but that's one of those cases where LC "helps" you along even > though you're doing wrong. I don't think so... It's documented as a keyword not a function. -

Re: Keys of a custom property array

2013-03-03 Thread Richard Gaskin
It seems there are two types of arrays storable in LC props, what I like to call "Natural" and "Unnatural": "Natural" arrays are one-dimensional, and fit into the traditional view of custom props as having one or more property sets, each of which is comprised of properties, each of which has a

Re: Keys of a custom property array

2013-03-03 Thread Mark Wieder
Monte- Sunday, March 3, 2013, 7:08:10 PM, you wrote: > On 04/03/2013, at 1:44 PM, Mark Wieder wrote: >> Actually, that needs to be in parentheses because url is a function. >> As in >> >> put url("file:"&it) into tDataStream > If you're in the right folder you can: > put url "file:index.html"

Re: Keys of a custom property array

2013-03-03 Thread Peter Haworth
I've run into other circumstances where using parens makes an expression yield the correct results. I can't think of them off the top of my head but the resukt has been that I probably use an overabundance of parens in my code so I don't have to worry about things working correctly. That's how I

Re: Keys of a custom property array

2013-03-03 Thread Monte Goulding
On 04/03/2013, at 1:44 PM, Mark Wieder wrote: > Actually, that needs to be in parentheses because url is a function. > As in > > put url("file:"&it) into tDataStream If you're in the right folder you can: put url "file:index.html" into tHTML -- M E R Goulding Software development services Bes

Re: Keys of a custom property array

2013-03-03 Thread Mark Wieder
Jacque- Sunday, March 3, 2013, 6:30:38 PM, you wrote: > On 3/3/13 8:08 PM, dunb...@aol.com wrote: >> Jacque. It just occurred to me that placing the custom property >> identifier in parentheses does not force an evaluation, it just helps >> the parser, well, parse. > I remember when I had troub

Re: Keys of a custom property array

2013-03-03 Thread J. Landman Gay
On 3/3/13 8:08 PM, dunb...@aol.com wrote: Jacque. It just occurred to me that placing the custom property identifier in parentheses does not force an evaluation, it just helps the parser, well, parse. I remember when I had trouble getting URL content and was told it had to be in parentheses t

Re: Keys of a custom property array

2013-03-03 Thread J. Landman Gay
On 3/3/13 6:25 PM, dunb...@aol.com wrote: I am a big fan of forced evaluation. So why doesn't: do "get the keys of the testArray of me" or do "get the keys of" && the testArray of me work? It works if you add the parentheses: do "get the keys of (the testArray of me)" But it's weird.

Re: Keys of a custom property array

2013-03-03 Thread dunbarx
pile, well, just because. Craig -Original Message- From: Mark Wieder To: How to use LiveCode Sent: Sun, Mar 3, 2013 8:41 pm Subject: Re: Keys of a custom property array Craig- Sunday, March 3, 2013, 4:25:29 PM, you wrote: > do "get the keys of the testArray of me"

Re: Keys of a custom property array

2013-03-03 Thread Mark Wieder
Craig- Sunday, March 3, 2013, 4:25:29 PM, you wrote: > do "get the keys of the testArray of me" What's me? -- -Mark Wieder mwie...@ahsoftware.net ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsub

Re: Keys of a custom property array

2013-03-03 Thread dunbarx
Mark, Jacque. I am a big fan of forced evaluation. So why doesn't: do "get the keys of the testArray of me" or do "get the keys of" && the testArray of me work? Craig ___ use-livecode mailing list use-livecode@lists.runrev.com Please vi

Re: Keys of a custom property array

2013-03-03 Thread J. Landman Gay
On 3/3/13 1:44 PM, Mark Wieder wrote: Jacque- Sunday, March 3, 2013, 11:20:38 AM, you wrote: Assuming speed isn't an issue either way, any idea which would be more memory-efficient? No idea. We'd have to know how and when the engine handles garbage collection. If you see significant speed di

Re: Keys of a custom property array

2013-03-03 Thread Mark Wieder
Jacque- Sunday, March 3, 2013, 11:20:38 AM, you wrote: > Assuming speed isn't an issue either way, any idea which would be more > memory-efficient? No idea. We'd have to know how and when the engine handles garbage collection. If you see significant speed differences in the different methods, th

Re: Keys of a custom property array

2013-03-03 Thread J. Landman Gay
On 3/3/13 1:02 PM, Mark Wieder wrote: Is your goal to save the time/resources of putting the array into a variable and then extracting the keys, or is it to save a couple of extra lines of code? Are you sure that the engine doesn't make a copy of the array under the hood and then extract the key

Re: Keys of a custom property array

2013-03-03 Thread Mark Wieder
Jacque- Sunday, March 3, 2013, 10:24:35 AM, you wrote: > On 3/3/13 12:37 AM, Peter Haworth wrote: >> Hi Jacque, >> I just tried: >> >> get the keys of (the uArray of button "xyz") >> >> ... and got the keys of uArray. > Cool. Thanks. I'd been through all the permutations that Craig posted, > and

Re: Keys of a custom property array

2013-03-03 Thread J. Landman Gay
On 3/3/13 12:37 AM, Peter Haworth wrote: Hi Jacque, I just tried: get the keys of (the uArray of button "xyz") ... and got the keys of uArray. Cool. Thanks. I'd been through all the permutations that Craig posted, and I also had tried parentheses, but those were included in a nested functio

Re: Keys of a custom property array

2013-03-03 Thread David Epstein
get the customKeys[myCustomPropertySetName] of myObject Jacqueline Gay asked: If I store an array as a custom property, is there a way to get its keys without putting the whole thing into a variable first? David Epstein ___ use-livecode mailin

Re: Keys of a custom property array

2013-03-02 Thread dunbarx
oes not work All I (thought I) knew about helping the parser do its thing comes to nought here. Each seems perfectly and unambiguously formed... Craig -Original Message- From: Peter Haworth To: How to use LiveCode Sent: Sun, Mar 3, 2013 1:38 am Subject: Re: Keys of a custom property array

Re: Keys of a custom property array

2013-03-02 Thread Peter Haworth
Hi Jacque, I just tried: get the keys of (the uArray of button "xyz") ... and got the keys of uArray. Pete lcSQL Software On Sat, Mar 2, 2013 at 8:06 PM, J. Landman Gay wrote: > If I store an array as a custom property, is there a way to get its keys > without putting t

Re: Keys of a custom property array

2013-03-02 Thread J. Landman Gay
On 3/3/13 12:26 AM, Mark Wieder wrote: Jacque- Saturday, March 2, 2013, 10:06:01 PM, you wrote: If I store an array as a custom property, is there a way to get its keys without putting the whole thing into a variable first? Sure, but it's roundabout and I can't guarantee that the engine does

Re: Keys of a custom property array

2013-03-02 Thread dunbarx
:06 am Subject: Keys of a custom property array If I store an array as a custom property, is there a way to get its keys without putting the whole thing into a variable first? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http

Re: Keys of a custom property array

2013-03-02 Thread Mark Wieder
Jacque- Saturday, March 2, 2013, 10:06:01 PM, you wrote: > If I store an array as a custom property, is there a way to get its keys > without putting the whole thing into a variable first? Sure, but it's roundabout and I can't guarantee that the engine doesn't end up doing that anyway. set the

Keys of a custom property array

2013-03-02 Thread J. Landman Gay
If I store an array as a custom property, is there a way to get its keys without putting the whole thing into a variable first? -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Software | http://www.hyperactivesw.com