Does this qualify?  Probably not what you were looking for (actually, just
building the "function" into the definition of 'e):

>> n: 0
== 0
>> e: [ 'e pick "fg" (n: (n + 1) // 2) + 1 ]
== ['e pick "fg" (n: (n + 1) // 2) + 1]
>> print e
e f
>> print e
e g
>> print e
e f
>> print e
e g

/Russ
----------------
At 09:37 PM 12/30/1999 -0600, you wrote:
>There are all sorts of ways to produce a value for 'e that will show
>the following behavior:
>
>    >> print e
>    e f
>    >> print e
>    e g
>    >> print e
>    e f
>    >> print e
>    e g
>
>A couple of odd-looking ones are:
>
>    e: func [/local x][
>        either #"f" = first (x: "f") [x/1: #"g"][x/1: #"f"]
>        join copy "e " x
>    ]
>
>and
>
>    e: func [/local x][
>        x: "e f" replace x third x select "fgf" third x x
>    ]
>
>Now for the puzzle part...  Construct a value for 'e that behaves
>as above, but without using a function.
>
>-jn-
>
>
>

Reply via email to