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

[REBOL] Re: Macro - function problems

From: al:bri:xtra at: 13-Mar-2002 17:48

Mark Dickson wrote:
> I am looking for help to write a MACRO transformation function.
I'm not sure what you want, but something like this might be helpful: use [Weekdays Index] [ Weekdays: system/locale/weekdays forall Weekdays [ Index: index? Weekdays system/locale/weekdays do reduce [ to set-word! join first Weekdays "?" 'func [ "Is Date this weekday?" Date [date!] ] reduce ['= Index 'Date/weekday] ] ] ] which produces this:
>> source Wednesday?
Wednesday?: func [ "Is Date this weekday?" Date [date!] ][= 3 Date/weekday] and is used like:
>> Wednesday? 13/Mar/2002
== true Andrew Martin ICQ: 26227169 http://valley.150m.com/