Hi GS Jones,

I didn't read your message as containing anything negative. 

In the version I'm using on the Website I use the make object! in the
calling function instead of in the retrieve-user-data function. That's
incidental.

The reason for make object! is:

decode-cgi returns a block that contains set-word! value pairs:

[name: "some-name" phone: "some-phone"]

To conveniently retrieve the values by using a path notation,
result/name result/phone I use the block returned by decode-cgi to
construct an object:

result: make object! decode-cgi input

If I were to simply say

result: decode-cgi input

then I wouldn't be able to access the values in the block using the path
notation in combination with the names: result/name wouldn't work
because in the block name appears as name: 

result/name: wouldn't work because upon parsing a set-word as the last
element of a path REBOL expects that you are changing the value
following the word name and I would get an error reporting that the
value being assigned to result/name: is missing.

The one option would be to reduce the block returned by decode-cgi. Then
name and phone will become global words that are associated with their
respective values. I prefer to work with words that are local to the
object's context to avoic conflicts with other words that may be in use.

Hope this helps,

Elan

GS Jones wrote:
> 
> No problem, Elan, and I certainly didn't mean to imply anything negative.
> Being new to the language, I just was "wondering out loud" that perhaps a
> change in the version of REBOL required a change in the method.  Through no
> one's fault but my own, I am unclear why a "make object!" is needed.
> Obviously, your site's version works both on your system and mine (at least
> when I am using /View), but not on Ryan's.  And Ryan says that his works
> with the "make object!" phrase left in, but only with GET.  When I use his
> version, all I get is "?object?" printed for the data.  As I have said to
> Carl R., I probably shouldn't be pitching my two pennies in because I am
> still a novice with REBOL.  But I like mysteries and solving them helps me
> learn the language more quickly.
> 
> Thanks for your input.
> --- Scott (The "S" in GS Jones)
> 
> > Hi GS Jones
> > [...]
> > > left out the "make object!" phrase.
> > [...]
> >
> > I didn't do that intentionally. I just happened to implement it that way
> > when I wrote the code for this Website.
> >
> > Elan
> 
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to