help-octave
[Top][All Lists]
Advanced

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

Re: forcing function execution as a core function or from a certain pack


From: Robert T. Short
Subject: Re: forcing function execution as a core function or from a certain package
Date: Tue, 10 Jul 2012 13:48:48 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

On 07/10/2012 01:07 PM, Sergei Steshenko wrote:



----- Original Message -----
From: Jordi Gutiérrez Hermoso <address@hidden>
To: Sergei Steshenko <address@hidden>
Cc: Octave users list <address@hidden>
Sent: Tuesday, July 10, 2012 10:55 PM
Subject: Re: forcing function execution as a core function or from a certain 
package

On 10 July 2012 15:54, Sergei Steshenko <address@hidden> wrote:
  So, how about introducing namespaces in Octave (instead of automatic
broadcasting) ?

We can't do that. Matlab conflicts. Matlab does indeed have some sort
of namespacing, but it doesn't really work:

http://abandonmatlab.wordpress.com/2010/05/30/the-mathworks-doesnt-even-know-how-to-look-up-functions-in-their-own-global-namespace/

- Jordi G. H.

The link you gave me does not at all prove Octave developers can't implement 
namespaces.

For example, Octave developers can implement namespaces as in Perl, i.e.

Foo::Doo:: ... Hoo::bar

notation is allowed and _demand_ that all Octave packages follow the scheme. 
This will be a superset of Matlab language, and traditional Matlab-like code 
will still pollute global namespace, but what comes from Octave and its 
packages will be clean.

Perl's built-in functions are called without '::' prefix, e.g.

substr
.

And, as in Perl, there should be a mechanism of explicit exporting into global 
namespace - sometimes it does make sense, a good example in Perl is POSIX 
module: http://perldoc.perl.org/POSIX.html . And not exporting is easy - the 
cost is _just_ '()', i.e. just _two_ characters.

Regards,
   Sergei.

_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


OK. I have a plan. Submit a patch for consideration and a plan for "forcing" everyone to follow your scheme.





reply via email to

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