I had in mind the general advice from Henry quoted by Dan:

>  Avoid using the parameter names x, y, u, v, m, and n 
>  ... when an explicit definition is running, those names 
>  are always evaluated before they are put onto the stack

But if you insist:

   'w...@z' ae NB. OK...
w...@z
   
   'w...@v' ae NB. Here it comes...
|value error: v
|   w...@    v
  





________________________________
From: Raul Miller <[email protected]>
To: General forum <[email protected]>
Sent: Wednesday, August 19, 2009 12:23:24 PM
Subject: Re: [Jgeneral] Looks like a bug in ".

On Wed, Aug 19, 2009 at 10:53 AM, Jose Mario
Quintana<[email protected]> wrote:
> That is right; unfortunately x, y, u, v, m, and n are peculiar
> characters which can explicitly strike back even if one tries to
> ignore them.  Using your very own anonymous evocation tool
> ( http://www.jsoftware.com/pipermail/programming/2007-November/008816.html )
> as an example:
>
>    ae =: ("_) (`(<1;~,'0')) (((<,':') <@:, (<1;~,'0') <@:, (,'0') <@:(;<) 
>,&>@:,@:(<^:(0=L.)))`) (`:6) ((<1;~,'0')`) (`:6)
>
>    x=. @[
>    y=. @]
>
>    '<y'ae NB. OK...
> <@]
>
>    '<x'ae NB. Here it comes...
> +-+
> |1|
> +-+

You raise an interesting issue, but ignoring x, u and m is
different from using them.

(That said, since ae uses a : definition -- albeit, covertly
-- I do not think I should prefer it over simpler explicit
expressions, such as was provided earlier in the
message you reference.)

-- 
Raul
----------------------------------------------------------------------

From: Dan Bron <[email protected]>
To: General forum <[email protected]>
Sent: Tuesday, August 18, 2009 5:07:27 PM
Subject: Re: [Jgeneral] Looks like a bug in ".

David Mitchell wrote:
>  I found these pages helpful as well as the excellent references above:
>  http://www.jsoftware.com/help/jforc/parsing_and_execution_ii.htm

Wow, I really need to review J for C Programmers.  It's a gold mine.  Look:

>  Avoid using the parameter names x, y, u, v, m, and n 
>  ... when an explicit definition is running, those names 
>  are always evaluated before they are put onto the stack 
>  (in other words, they are passed by value rather than 
>  by name, even if they are verbs).  Therefore, they 
>  produce value error if they are undefined when used.

and I was citing some old J Forum post!

-Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to