[Jprogramming] wat? (seems like a spurious value error from f.)
Raul Miller
rauldmiller at gmail.com
Wed Feb 19 00:52:13 UTC 2014
I am not comfortable with this line of thought, which has to do with paths
and searching other locales. All the names are in the writenif locale and I
am referencing a verb in that locale for its fully qualified name. So, for
the purpose of resolving names in its definition, the current locale should
be the writenif locale.
See also slides 17, 19, 25 and 26 of the Locales lab.
So I feel like something else has to be the issue here.
Thanks,
--
Raul
On Tue, Feb 18, 2014 at 7:29 PM, Vijay Lulla <vijaylulla at gmail.com> wrote:
> I'm not entirely sure but I think your answer lies somewhere in slides 52
> and 55-62 of the "Locales" lab.
>
>
> On Tue, Feb 18, 2014 at 7:18 PM, Raul Miller <rauldmiller at gmail.com>
> wrote:
>
> > But that would mean that I am storing variables in the wrong locale and
> > defeats the point of using separate locales in the first place.
> >
> > I will use a workaround, but I would like to understand what has gone
> wrong
> > here. Here's how to reproduce:
> >
> > cocurrent 'writenif'
> >
> > put=: 3 : ' 0 0$WRITENIF=:WRITENIF,,y'
> >
> > ic=: 3!:4
> >
> > write_int=: put@(2&ic)
> >
> > cocurrent 'base'
> >
> > write_int_writenif_ f.
> >
> > |value error: put
> >
> > Thanks,
> >
> > --
> > Raul
> >
> >
> > On Tue, Feb 18, 2014 at 5:18 PM, Vijay Lulla <vijaylulla at gmail.com>
> wrote:
> >
> > > Looking at definition of 18!:2 it states "If a name sought in locale f
> is
> > > not found in f , then it is sought in the locales in the path of f (but
> > not
> > > searching *their* paths)." Hence
> > >
> > > (;: 'writenif z') copath coname ''
> > >
> > > fixes the issue. I don't understand locales completely though!
> > >
> > >
> > > On Tue, Feb 18, 2014 at 4:37 PM, Raul Miller <rauldmiller at gmail.com>
> > > wrote:
> > >
> > > > Yes - in fact it does fix if I switch to that locale.
> > > >
> > > > What's odd is that I have had no problems with similar verbs in other
> > > > locales.
> > > >
> > > >
> > > >
> > > > --
> > > > Raul
> > > >
> > > >
> > > > On Tue, Feb 18, 2014 at 4:31 PM, Pascal Jasmin <
> godspiral2000 at yahoo.ca
> > > > >wrote:
> > > >
> > > > > this would fix in the current locale. (?) put is probably not in
> the
> > > > > current locale. f. is used as ducktyping in J for crosslocales,
> and
> > is
> > > > > needed behaviour for coinsert to work like inheritance.
> > > > >
> > > > >
> > > > > ----- Original Message -----
> > > > > From: Raul Miller <rauldmiller at gmail.com>
> > > > > To: Programming forum <programming at jsoftware.com>
> > > > > Cc:
> > > > > Sent: Tuesday, February 18, 2014 4:14:47 PM
> > > > > Subject: [Jprogramming] wat? (seems like a spurious value error
> from
> > > f.)
> > > > >
> > > > > Here is the definition of a verb defined in the writenif locale:
> > > > > write_int_writenif_
> > > > > put@(2&ic)
> > > > >
> > > > > Here are the definitions of the two verbs named in that definition:
> > > > > put_writenif_
> > > > > 3 : ' 0 0$WRITENIF=:WRITENIF,,y'
> > > > > ic_writenif_
> > > > > 3!:4
> > > > >
> > > > > Here is what happens when I try to fix that definition:
> > > > > write_int_writenif_ f.
> > > > > |value error: put
> > > > > | write_int_writenif_ f.
> > > > >
> > > > > I get similar errors when I try to use those verbs, which is why I
> > was
> > > > > using fix - to try and isolate the error.
> > > > >
> > > > > I'm not seeing what I did wrong here. Can someone help me out?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > --
> > > > > Raul
> > > > >
> > ----------------------------------------------------------------------
> > > > > For information about J forums see
> > http://www.jsoftware.com/forums.htm
> > > > >
> > > > >
> > ----------------------------------------------------------------------
> > > > > For information about J forums see
> > http://www.jsoftware.com/forums.htm
> > > > >
> > > >
> ----------------------------------------------------------------------
> > > > For information about J forums see
> http://www.jsoftware.com/forums.htm
> > > >
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
More information about the Programming
mailing list