3 ms·
btw, Rebol solved the mixing of options and filenames by introducing a syntax for file references; u prefix them with a percent sign, eg.: %/c/plug-in/video.r
by onetom 4y ago
btw, Rebol solved the mixing of options and filenames by introducing a syntax for file references; u prefix them with a percent sign, eg.:
%/c/plug-in/video.r
%//sound/goldfinger.mp3
%"/c/program files/qualcomm/eudora mail/out.mbx"
%c:/docs/file.txt
%\some\cool\movie.mpg <= understood backslashes too, so it worked in DOS/Windows too!
%cool%20movie%20clip.mpg
Source: http://www.rebol.com/docs/core23/rebolcore-12.html#section-2.1 http://www.rebol.com/docs/core23/rebolcore-12.html#section-2...
then you could mix them with `:get-words` and `set-words:`.
Rebol also had an interesting take on options - with and without arguments -; it called them refinements and you would just stack them with slashes onto the "command". the refinement arguments were added to the end of the parameter list though, so it was not exactly obvious which argument belonged to which refinement, but in practice it worked quite nice, surprisingly:
str: "test"
insert/dup/part str "this one" 4 5
print str
=> this this this this test
and reversing /dup and /part:
str: "test"
insert/part/dup str "this one" 4 5
print str
=> thisthisthisthisthistest
Source: http://www.rebol.com/docs/core23/rebolcore-9.html#section-2.3 http://www.rebol.com/docs/core23/rebolcore-9.html#section-2....