[scilab-Users] path
Samuel Gougeon
sgougeon at free.fr
Wed Oct 12 23:32:04 CEST 2011
Le 12/10/2011 22:12, Ricardo Fabbri a écrit :
> .../..
> What would one do in cases where the original function is actually a
> built in which returns something and doesn't need to be called with '(
> )' :
>
> pw=pwd
>
> This does not make pw an alias to pwd. The only way I got this to work
> was through the funptr/newfun combination I mentioned:
> newfun("pw",funptr("pwd"));
>
Yes, you are right, after having checked that the function is not a macro.
So the required stuf (test and newfun or assignment) could make an
alias() macro ;)
> @Samuel + @Serge:
>
> I opened a feature request in scilab regarding the PATH idea:
> bug #10094
>
> It would be cool to have Serge's implementation, although I'd like
> non-functions as well as this is very handy for really quick
> development of ideas.
>
Yes, i agree (twice).
After the very nice trick given by Serge, Googling and bugzilling
%onprompt is
giving some pointers:
http://bugzilla.scilab.org/show_bug.cgi?id=2441
and http://bugzilla.scilab.org/show_bug.cgi?id=2253#c4 See comment #6
on this thread,
where Serge attached an autoload package including a %onprompt release
and documented.
@ Serge:
Why not proposing autoload as an ATOMS or in FileExchange?
Isn't there any way to catch from %onpromt() the content of the
instruction(s)
just entered, and possibly to clear it before being run after %onprompt
(whether the instruction is a single word aknowledged as the name of a
script
reachable through a declared path)? Another trick for the evening? :-)
Samuel
More information about the users
mailing list