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

[REBOL] REBOL Assign command.

From: edanaii::cox::net at: 28-Dec-2002 9:03

All, I don't know if this has ever been done, so I did it myself. Created something similar to the Assign command on the Amiga. Here is the code: ========== REBOL [] Assign: Func [ "Creates an Amiga-like Assign command." Volume [ Word!] "The function that this command will create." Path [ String! File! ] "The directory path that will be assigned to it" ] [ Do Rejoin [ Volume ": Func [ AssignPath ] [ Return to-file Join %" Path " AssignPath ] " ] ] ========== It creates another function that returns the path specified when called. So, for example, to create an Assign to locate REBOL Source code: ASSIGN 'REBSOURCE C:REBOL/SOURCE I can then call it to get source files: DO REBSOURCE HOWDY.R But if I call it to read a directory, I still need to pass a parameter. READ REBSOURCE "." This is slightly cumbersome. So, all that being said, is there a way to make parameters optional in REBOL? So far, in my meager investigations, I have not found a way. I'd like to complete the function so that it can be called like this: READ REBSOURCE, no parameters. -- Sincerely, | The problems of two little people don't amount to Ed Dana | a hill of beans in this crazy mixed-up world! But Software Developer | this is OUR hill, and these are OUR beans! 1Ghz Athlon Amiga | -- Naked Gun via Casablanca.