[REBOL] DOing a script from REBOL.org
From: SunandaDH:aol at: 31-Oct-2006 5:30
Hidden in the Library Recent Changes thread, Carl Read asked:
> Shouldn't this just, you know, work...
Gregg suggested using the "plain text" version of the script in the Library:
And Anton diagnosed REBOL's inability to parse the script from the webpage as
a documentation and/or coding problem in REBOL -- an embedded script needs to
start with a newline.
The Library now emits the HTML with a newline before the script header.
This means that many scripts are DO-able from their Library webpage.
Thanks to Carl and Gregg and Anton for raising and fixing the problem.
Unfortunately, _many_ scripts are Do-able, but not the one in question.
texture-lab.r contains greater-than and less-than signs. These are escaped to
character entities in the HTML page, and that creates a syntax error.
Gregg's solution still stands: use the version intended for execution rather
than the one prettied up for display.
Other alternatives include:
-- download the script and run it locally.
-- download the whole Library, and run the one script locally:
Those first two suggestions work even when the library isn't available.
-- Use the Library Data Services interface. Normally (see below for exception
**) this best as it allows you to specify which version of a script you want
to run -- the Library may have multiple versions of a script, and the most
recent one may not be the one you want.
res: lds/send-server 'get-archive-version ["texture-lab.r/1"]
do decompress res/data/script
Normally, this would run Version 1 of texture-lab.r
If there were other verisons, you could check them here:
And that would work with most scripts in the Library.
** Sadly, texture-lab.r is an exception: it checks its own REBOL header. That
means it is assuming it is running as a Do %name. So it fails as it can't
You could always save it to a temporary file and do it from there.
Who said the X-Internet was easy!?
Moral of the story: listen to Gregg.