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

[REBOL] Re: do %image.png

From: jasonic:panix at: 15-Nov-2001 11:36

Hi Ingo
> Rebol was designed to be run when imbedded into other data, > e.g. you can run a script directly from an email, without > having to clean it first.
within ascii text yes.
> So, you can 'do %image.png if the script itself is stored in > normal ASCII within the binary data, but it Won't work the way > Ryan suggested, the way to go is, embed the whole script into > a block, like this > > [REBOL [] > print { > You can save this email, e.g. to %mymail.r, > and 'do %mymail.r in a REBOL session. > } > ]
I tried that with and wihout linefeeds as well. No luck. AS far as I can see, REBOL *is* expecting to parse a REBOL block from wihtin ascii text. Are you saying REBOL "do" currently parses a binary automatically, and looks for text containing script in a block ? ^/[REBOL[]print "here's looking at you from inside image.png"] I would be surprised and very delighted if this is true now. Somebody show me an example please! Emanehiel it seems we must build it. But I hope an efficient implementation of this will become true in a version of REBOL soon: do/binary %image.png The /binary refinement is what seems to be missing. Because it is a special case, one would not want to slow down the default "do" behavior. It could reasonably be an implicit /binary, which is invoked as soon as do sees it is dealing with something that is not a .r file: <wishlist examples> do %somescript.r do %image.png ; runs a default implied "do/binary" refinement do/binary %image.png png-options png-options might load a config file "binary-png.r" similar to user.r for tuning the response of do/binary do/binary %tracks.midi midi-options would handle that format etc.. </wishlist>
> (IIRC, the rules are: > find newline followed be "REBOL" and a block > --> starting from REBOL unto the end is a rebol script > find newline followed by "[REBOL" and a block > --> the script ends at the closing bracket
demo please? does not work for me.. thanks -Jason