octave-maintainers
[Top][All Lists]
Advanced

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

Re: Octave and GSOC'2008


From: Jaroslav Hajek
Subject: Re: Octave and GSOC'2008
Date: Thu, 28 Feb 2008 13:55:07 +0100

what about just making the symbol name a property of
symbol_table::symbol_record rather
than symbol_record_rep and thus allow a symbol to be referenced under
different names?
One could then provide functions like alias(name,alias) and
aliasin(name,alias,context),
to be used in m-files relatively conveniently like this:

function zero11(name)
aliasin(name,'A','caller')
if (A.is_matrix())
  A(1,1) = 0
else
  error("%s is not a matrix",name)
endif
endfunction

...
X = rand(5)
zero11("X");

No new syntax is introduced, just two new functions. Since
symbol_record_rep is not used outside symbol_record, I think that the
modification would be smooth.

What do you think?

-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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