Hmm....

Here's how to emulate julia's behavior in J (assuming I have
understood you correctly):

   g=: 9: f.
   g''
9
   f=: g: f.
   f''
9
   g=: 20"_ f.
   g''
20
   f''
9

Removing the f. from each definition would resolve the problem (and
all but one of them was irrelevant).

Basically, it sounds like you are talking about delayed resolution of
some names. In J we have delayed resolution for verb names and
immediate resolution for other names (and undefined names are thus
parsed as verbs).

It sounds like Julia uses the definition of g in f rather than simply
referring to g. Depending on the language spec, this might not even be
a bug. If it is a bug, the resolution would probably be to retain both
the original definition and the machine implementation and to also set
up a dependency so that whenever g gets update f gets rebuilt. That
would be simple enough to implement, but if it conflicts with the
language spec (or if it's purely student driven) it might not happen.

Thanks,

-- 
Raul

On Tue, Feb 4, 2014 at 4:16 PM, Scott Locklin <[email protected]> wrote:
>> What can we learn from this?
>
> Julia is a noble effort, and parts of it are a wonderful idea, but ... a 
> friend of mine spotted this more than a year ago, and it hasn't been fixed 
> yet. They claim it is difficult to fix, which to my mind means there are 
> either fundamental engineering problems with the way namespaces work in 
> Julia, or they don't know what they're doing.
>
>
> *****************
>
> function g()
>         9
> end
>
>
>>>g (generic function with 1 method)
>
> function f()
>         g()
> end
>>>f (generic function with 1 method)
>
> julia> f()
>>>9
>
> function g()
>         20
>
> end
>
>>>g (generic function with 1 method)
>
> julia> f()
>>> 9
>
>
> *************
>
> Lush is an earlier version of the same idea as Julia, FWIIW (aka high level
> numerics with a compiler, though with a radically different design and
> set of compromises -compromises Julia should have learned from). It doesn't 
> have this issue. While I haven't looked at the guts of Julia, the guts of 
> Lush are intensely beautiful in places.
>
> -Scott
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to