[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: |
Sergei Steshenko |
Subject: |
Re: forcing function execution as a core function or from a certain package |
Date: |
Tue, 10 Jul 2012 13:07:35 -0700 (PDT) |
----- 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.
- forcing function execution as a core function or from a certain package, Sergei Steshenko, 2012/07/10
- Re: forcing function execution as a core function or from a certain package, Jordi Gutiérrez Hermoso, 2012/07/10
- Re: forcing function execution as a core function or from a certain package, Sergei Steshenko, 2012/07/10
- Re: forcing function execution as a core function or from a certain package, Jordi Gutiérrez Hermoso, 2012/07/10
- Re: forcing function execution as a core function or from a certain package,
Sergei Steshenko <=
- Re: forcing function execution as a core function or from a certain package, Jordi Gutiérrez Hermoso, 2012/07/10
- Re: forcing function execution as a core function or from a certain package, Sergei Steshenko, 2012/07/10
- Re: forcing function execution as a core function or from a certain package, Jordi Gutiérrez Hermoso, 2012/07/10
- Re: forcing function execution as a core function or from a certain package, Sergei Steshenko, 2012/07/13
- Re: forcing function execution as a core function or from a certain package, Robert T. Short, 2012/07/10
- Re: forcing function execution as a core function or from a certain package, Sergei Steshenko, 2012/07/10
- Re: forcing function execution as a core function or from a certain package, Juan Pablo Carbajal, 2012/07/11