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

[REBOL] Re: Accessing a script from itself

From: antonr:lexicon at: 15-Jan-2005 20:30

If you wrote the script, or if you modify the script's header before doing it, then you can make the script content available by setting CONTENT: TRUE in the header. eg.
>> write %afile.r {rebol [content: true] print "hello" probe
system/script/header/content}
>> do %afile.r
Script: "Untitled" (none) hello {rebol [content: true] print "hello" probe system/script/header/content} == {rebol [content: true] print "hello" probe system/script/header/content} I remember there was a quine (a program which reproduces itself) which used this method. Anton.