[EMAIL PROTECTED] wrote:
>
> 2. Can you create a line of REBOL code, including two or more
> functions of arity one or more (that take one or more parameters),
> that results in the same result forwards or backwards? To verify, put
> the code in a block, and try:
>
> (do block) = do reverse block
>
> And it's no fair padding either side of the block! ie:
> [1 1 print 1 print 1 1]
>
> (Okay that one's convoluted...)
>
I'm sure these aren't what you meant 8-} but I couldn't resist...
>> od: [do od]
== [do od]
>> do [do od]
** Internal Error: Stack overflow.
** Where: do od
On the other hand, it is REALLY the same forwards and backwards!
Then there's
>> foo: func ['w] [source :w]
>> do [foo foo]
foo: func ['w][source :w]
which is word palindromic, instead of character palindromic.
But that leads to the creation of...
>> baz: func ['w] [
return join copy "" [{the argument was "} w {"}]
]
>> do [print baz print]
the argument was "print"
...which can be extended arbitrarily...
>> do [print baz "anything" length? "anything" baz print]
the argument was "anything"
== {the argument was "print"}
Finally, just to get the rest of the orneryness out of my system
(you only said "same result", you didn't say anything about the
code having to be valid ;-)
>> do [able I was ere I saw elba]
** Script Error: able has no value.
** Where: able I was ere I
-jn-