help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: named arguments


From: Francesco Potortì
Subject: Re: named arguments
Date: Sat, 17 Mar 2012 10:20:46 +0100

My two cents, without any offer of working on implementation, sorry.

>| This would be a big change and we should worry over it pretty hard and keep 
>it
>| optional, but I think it would be a GREAT addition to the language if we 
>could
>| do it right.
>
>Optional makes no sense.  Now you are requiring someone to have a
>version of Octave compiled or run with the right switches in order to
>run your code?

I see some possible solutions, given that someone volunteers to
implement them.

One is to use a switch internal to the code, that is, a variable which
enables the requested syntax.  It is a solution to the single problem of
having to run Octave with given switches.  The day Octave will have to
implement a different syntax it will emit a warning when running code
that sets that variable.

Another is writing a preprocessor that converts the new syntax to code
using parseparams.  This could be an external program that preprocesses
the code and then feeds it to Octave, or an Octave function that reads a
file, preprocesses it end then evals the resulting code.  None of these
would work with function files called by scripts, however.  Maybe a
solution could be a preprocessor that is called as the first instruction
of the function file: inefficient but convenient.

-- 
Francesco Potortì (ricercatore)        Voice:  +39.050.315.3058 (op.2111)
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Fax:    +39.050.315.2040  
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it


reply via email to

[Prev in Thread] Current Thread [Next in Thread]