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

[REBOL] Re: [RWEBOL] HOF and system exploration

From: jan:skibinski:sympatico:ca at: 26-Oct-2002 8:50

Hi Ladislav, A quick note related to this fragment of your last email..
> To show you the complications with DO, here is a simple task: > > Define a functional (let's call it SIMILAR) taking an ANY-FUNCTION! F, which > can take one normally evaluated ANY-TYPE! argument. The result of SIMILAR > should be a FUNCTION! value that yields equal results as the argument > function F would yield. One possible solution is: > > similar: func [f [any-function!]] [func [arg [any-type!]] compose [(:f) > get/any 'arg]] > > Now try to "correct" SIMILAR to work when it obtains DO as its argument :-) >
I do not understand the task you posed. As far as I can see there is nothing to "correct" in your 'similar. Works like a charm for me, even with 'do: lado: similar :do
>> lado sine 90
== 1
>> lado [5 sine 90]
== 1 Jan