[REBOL] Re: paths & lookups & change

2003-10-27 Thread Maxim Olivier-Adlhoch
robert M. wrote > Hi, I made several test WRT use blocks VS objects. To me it > showed up that > blocks are more flexible (it can be expanded) and neutral in > that those > molded blocks can be read by other applications without a big > problem. > Robert Since you can use path not

[REBOL] Re: paths & lookups & change

2003-10-26 Thread "Robert M. Münch"
On Thu, 23 Oct 2003 23:30:11 -0700, Elan <[EMAIL PROTECTED]> wrote: > My preference for this kind of tasks is using objects. Even though it is > a little more verbose, I find it quite intuitive to use the get and set > functions, as in: > ... Hi, I made several test WRT use blocks VS objects. To

[REBOL] Re: paths & lookups & change

2003-10-24 Thread Brett Handley
> > db: [id1 [name "Joe" num 32]] > > > > to be read with > > > > db/id1/name > > db/id1/num > > why is it that I missed this path ('select) notation for 4 years? There's a discipline that needs to followed with REBOL. Once you think you feel confident about how to do things, it is precis

[REBOL] Re: paths & lookups & change

2003-10-24 Thread Elan
Or - then again - maybe not. ;-) Elan wrote: >Hi Romano. > >Right. Looks like a 'mold bug. The mold output in this case is: > >== { >make object! [ >first word: 1 >]} > >Should be: >== { >make object! [ >"first word": 1 >]} > > >Elan. > > > > > -- To unsubscribe from this list, just

[REBOL] Re: paths & lookups & change

2003-10-24 Thread Elan
Hi Romano. Right. Looks like a 'mold bug. The mold output in this case is: == { make object! [ first word: 1 ]} Should be: == { make object! [ "first word": 1 ]} Elan. Romano Paolo Tenca wrote: >Hi Elan, > > > >> >> db: make object! reduce [ to-set-word "first word" 1 to-set-word

[REBOL] Re: paths & lookups & change

2003-10-24 Thread Maxim Olivier-Adlhoch
> For very small blocks of data, i like the form: > > db: [id1 [name "Joe" num 32]] > > to be read with > > db/id1/name > db/id1/num why is it that I missed this path ('select) notation for 4 years? DOH! -Max -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED

[REBOL] Re: paths & lookups & change

2003-10-24 Thread Romano Paolo Tenca
Hi Elan, > >> db: make object! reduce [ to-set-word "first word" 1 to-set-word > "second word" 2 ] but these don't work: probe do mold make object! reduce [ to-set-word "first word" 1] probe do mold/all make object! reduce [ to-set-word "first word" 1] and objects use a little more m

[REBOL] Re: paths & lookups & change

2003-10-23 Thread Elan
Hi Robert. My preference for this kind of tasks is using objects. Even though it is a little more verbose, I find it quite intuitive to use the get and set functions, as in: >> db: make object! reduce [ to-set-word "first word" 1 to-set-word "second word" 2 ] >> probe db make object! [ f

[REBOL] Re: paths & lookups & change

2003-10-23 Thread Brett Handley
Hi Robert, Thanks for the explanation of your reasoning. Looking at the Core guide, paths look purpose-built for this sort of database. So your reasons have good company :^) Regards, Brett. > Hi, there are several reasons: > > - For storing data I'm always working with nested blocks of name/val

[REBOL] Re: paths & lookups & change

2003-10-22 Thread "Robert M. Münch"
On Wed, 22 Oct 2003 20:07:21 +1000, Brett Handley <[EMAIL PROTECTED]> wrote: > Maybe this situation indicates that the "why" of Robert's need should be > looked at? So Robert, Why did you want the special set-path form - to > save your fingers or for some other reason? Hi, there are several re

[REBOL] Re: paths & lookups & change

2003-10-22 Thread Gabriele Santilli
Hi Brett, On Wednesday, October 22, 2003, 12:07:21 PM, you wrote: BH> .. should instead store the function in the block rather than doing an BH> internal evaluation on it. That way it becomes more complimentary to Select. My worry is, that if you need to operate on the previous value, such a

[REBOL] Re: paths & lookups & change

2003-10-22 Thread Brett Handley
Hi Gabriele, Robert, Interesting comments about the Find - I took Robert to mean that he didn't need to use the word Find in his code or data structure, but I see your point that evaluation of the path will likely cause an internal search operation. I'm certainly not defending my code example - i

[REBOL] Re: paths & lookups & change

2003-10-22 Thread Gabriele Santilli
Hi Robert, On Tuesday, October 21, 2003, 9:56:23 PM, you wrote: test: ["Bug Report" 1] >> == ["Bug Report" 1] key: "Bug Report" >> == "Bug Report" do reduce [to-set-path reduce ['test :key] 1 + test/:key] >> == ["Bug Report" 2] test >> == ["Bug Report" 2] RMM> Hi Brett, than

[REBOL] Re: paths & lookups & change

2003-10-21 Thread "Robert M. Münch"
On Sun, 19 Oct 2003 03:44:30 +1000, Brett Handley <[EMAIL PROTECTED]> wrote: > You can sort of, but you may not want to :-) > >>> test: ["Bug Report" 1] > == ["Bug Report" 1] >>> key: "Bug Report" > == "Bug Report" >>> do reduce [to-set-path reduce ['test :key] 1 + test/:key] > == ["Bug Report"

[REBOL] Re: paths & lookups & change

2003-10-21 Thread "Robert M. Münch"
On Mon, 20 Oct 2003 12:30:54 +1000, Anton Rolls <[EMAIL PROTECTED]> wrote: > Oh, I see what you're trying to do. > I agree there seems to be missing a > native to set the selected value. Hi, yes correct that's the problem. > We have SELECT to get the value, but > we have nothing to set the val

[REBOL] Re: paths & lookups & change

2003-10-19 Thread Joel Neely
Hi, Robert, Types are the issue... See below. Robert M. Münch wrote: > On Sat, 18 Oct 2003 11:28:07 +0200, Ingo Hohmann <[EMAIL PROTECTED]> wrote: >> >> >> change next pos: find test key pos/2 + 1 >>== [] >> >> test >>== ["Bug Report" 2] >> >>Though I'm sure, someone will come up with a better

[REBOL] Re: paths & lookups & change

2003-10-19 Thread Anton Rolls
Oh, I see what you're trying to do. I agree there seems to be missing a native to set the selected value. We have SELECT to get the value, but we have nothing to set the value, except the long solutions so far offered. Anton. > On Sat, 18 Oct 2003 19:57:52 +1000, Anton Rolls <[EMAIL PROTECTED]

[REBOL] Re: paths & lookups & change

2003-10-18 Thread Brett Handley
> test/:key: test/:key + 1 > > How can I do such a thing? Using to-set-path? I tried but failed. Robert You can sort of, but you may not want to :-) >> test: ["Bug Report" 1] == ["Bug Report" 1] >> key: "Bug Report" == "Bug Report" >> do reduce [to-set-path reduce ['test :key] 1 + test/:key] ==

[REBOL] Re: paths & lookups & change

2003-10-18 Thread "Robert M. Münch"
On Sat, 18 Oct 2003 19:57:52 +1000, Anton Rolls <[EMAIL PROTECTED]> wrote: > Robert, which addition operator are you going > to use :-D Hi, no comment :-| Robert -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with unsubscribe as the subject.

[REBOL] Re: paths & lookups & change

2003-10-18 Thread "Robert M. Münch"
On Sat, 18 Oct 2003 11:28:07 +0200, Ingo Hohmann <[EMAIL PROTECTED]> wrote: > You're doing both of the above in one line, so the '+ eats away one of > 'add s arguments Even in the danger I repeat myself: no comment > I'd like that, too ;-) But until then, this works: > > >> change next pos: fi

[REBOL] Re: paths & lookups & change

2003-10-18 Thread Anton Rolls
Robert, which addition operator are you going to use :-D I count two additions, I think you only want one: add (select test key) 1 or (select test key) + 1 Anton. > >> add (select test key) + 1 > ** Script Error: add expected value2 argument of type: number pair char > money

[REBOL] Re: paths & lookups & change

2003-10-18 Thread SunandaDH
Robert: > I would like to write something like this, to increment the integer in the > block: > > test/:key: test/:key + 1 That'd be a great extension to the language. > How can I do such a thing? Using to-set-path? I tried but failed. Robert This works, and you could make a function of i

[REBOL] Re: paths & lookups & change

2003-10-18 Thread Ingo Hohmann
Hi Robert, Robert M. Münch wrote: > Hi, I seem to be stucked here: > > >>>test > > == ["Bug Report" 1] > >>>key > > == "Bug Report" > >>>type? select test key > > == integer! > >>>add select test key + 1 > > ** Script Error: Cannot use add on string! value > ** Near: add select test key