Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: string to object - was: Ask

From: ammoncooke::yahoo at: 27-Sep-2001 23:20

----- Original Message ----- From: "Gregg Irwin" <[greggirwin--starband--net]> To: <[rebol-list--rebol--com]> Sent: Thursday, September 27, 2001 7:23 PM Subject: [REBOL] Re: string to object - was: Ask
> Hi Ammon, > > << Some one also mentioned 'get. It seems to work as well, or even better > for > some things. >> > > Yeah, what I want is something that just retrieves the data. If I use 'do,
I
> may cause execution of code that I don't want to execute. Correct? > > I can make 'get work to some extent, but I haven't found the magic > combination > for reaching my ultimate goal. > > These work fine: > > >> probe get in system to-word "options" > >> probe get in system/options to-word "cgi" > > This does not, unless I use 'do on sys-opt. Tried a number of other things > with no success:
here is what I got from the Command Console:
>> probe get in system/options to-word "cgi"
make object! [ server-software: none server-name: none gateway-interface: none server-protocol: none server-port: none request-method: none path-info: none path-translated: none script-name: none query-string: none remote-host: none remote-addr: none auth-type: none remote-user: none remote-ident: none Content-Type: none content-length: none other-headers: [] ]
>> probe get in system to-word "options"
make object! [ home: %/C/Documents and Settings/amunition.TRICOM/Desktop/REBOL/ script: none path: %/C/Documents and Settings/amunition.TRICOM/Desktop/REBOL/ boot: %/C/Documents and Settings/amunition.AMMON/Desktop/REBOL/rebol.exe args: none do-arg: none link-url: none quiet: true trace: false help: false install: false boot-flags: 2064 binary-base: 16 cgi: make object! [ server-software: none server-name: none gateway-interface: none server-protocol: none server-port: none request-method: none path-info: none path-translated: none script-name: none query-string: none remote-host: none remote-addr: none auth-type: none remote-user: none remote-ident: none Content-Type: none content-length: none other-headers: [] ] ] Is that what you are looking for?
> >> sys-opt: "system/options" > == "system/options" > >> probe get in do sys-opt to-word "cgi" > > So, is it possible to do it without 'do, or can we safely use 'do without > side effects? >
I personally would avoid 'do unless you definetly want the code DOne. However, if you are using
>>probe do in system to-word "options"
It does NOT polute the global namespace, in fact I can't see a harmful side-effect. Because:
>>probe do in system to-word "options"
does 'options in 'system.
> I think it must be possible because the uses for dynamic reflection are
just
> to good to live without. :)
Oh, it defenetly is possible! If you are pointing to an object! in an object! 'do works great, but otherwise 'do WILL polute the global namespace.