[REBOL] Re: command line [arguments] [Coding Style]

2004-04-06 Thread Ed O'Connor
Max wrote: > rebol prefered (and simpler) style: > > either none? system/script/args [ > print "no args" > ][ > print "args waiting" > ] Someone else will probably jump on this, but see Zine Issue #2 for style suggestions on this particular example: http://www.rebolforces.com/zine/rzine-1-02/#se

[REBOL] Re: [Function] with [Variable number of args]

2004-04-06 Thread Gerard Cote
Thanks to you all, Christophe, Cyphre, Volker, Anton and indirectly others too for your comments and vision about how to effectively use REBOL for solving the daily challenges we all have as "programmers" ... Your solutions will be studied diligently since they also showed me other interesting

[REBOL] command line [arguments]

2004-04-06 Thread tony summerfelt
On Tue, 6 Apr 2004 13:53:53 -0400, you wrote: >rebol prefered (and simpler) style: >either none? system/script/args [ thanks, i'll use that instead... i got the previous style from an example in the rebol library -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED]

[REBOL] command line arguments

2004-04-06 Thread tony summerfelt
On Mon, 5 Apr 2004 23:07:54 +1000, you wrote: >What was the error ? this is the section of code in question: Rebol [] either not system/script/args == none [ arg: system/script/args arg: parse arg "" log: to-file arg/1 binkd-log: read/lines log days: to

[REBOL] Re: command line [arguments]

2004-04-06 Thread Maxim Olivier-Adlhoch
> -Original Message- > From: tony summerfelt [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 06, 2004 1:33 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] command line arguments > > > > On Mon, 5 Apr 2004 16:25:19 +1200, you wrote: > > >> > either system/script/args [ > >> >instead of:

[REBOL] command line arguments

2004-04-06 Thread tony summerfelt
On Mon, 5 Apr 2004 16:25:19 +1200, you wrote: >> > either system/script/args [ >> >instead of: >> >> either not system/script/args == none [ >> got an error when i tried that: >Then you almost certainly have an error in the code before this point. :) here are the first few lines of the program

[REBOL] Re: [Function] with [Variable number of args]

2004-04-06 Thread Anton Rolls
Of course, one has to be careful that the result of the expression following this "magical" function does not get eaten up by mistake. In this case, you should wrap in parens. Example (imagine in a script): (f 1) ; now let's do some real work ; lots of comments...

[REBOL] Re: [Function] with [Variable number of args]

2004-04-06 Thread Volker Nitsch
On Dienstag, 6. April 2004 11:13, Robert M. Münch wrote: > On Tue, 6 Apr 2004 08:12:01 +0200, Coussement Christophe > > <[EMAIL PROTECTED]> wrote: > > I once use this little trick for handling a variable number of argument: > > > > f: func [a [integer!] b [unset! integer!]][either value? 'b [a + b

[REBOL] Re: [Function] with [Variable number of args]

2004-04-06 Thread Robert M. Münch
On Tue, 6 Apr 2004 08:12:01 +0200, Coussement Christophe <[EMAIL PROTECTED]> wrote: > I once use this little trick for handling a variable number of argument: > > f: func [a [integer!] b [unset! integer!]][either value? 'b [a + b][a]] Hi, clever! This is a very cool trick... I hope I remember

[REBOL] Re: [Function] with [Variable number of args]

2004-04-06 Thread Cyphre
Hi Gerard, I'm using simmilar trick to Christophe's. example: f: func [ a [any-type!] b [any-type!] c [any-type!] d [any-type!] e [any-type!] ][ foreach v bind first :f 'a [ print [ v either unset? get/any v [ "not defined"