Here's a slightly cleaned up variant, and an explanation and a suggestion...

require 'math/calculus'
Ddot =: pderiv_jcalculus_

times =: 4 : 0
  x*y
)

Times =: 4 : 0
  res =: x * y
  res
)


(times) works with Ddot, but (Times) does not.

   3&times Ddot 1 (4)
3
   3&Times Ddot 1 (4)
|spelling error
|   Xvcv98df9d =. 3&(4 : 0)
  res =: x * y
  res
)
|                          ^
|       ".'Xvcv98df9d =. ',u


The issue is that ". cannot handle multi-line expressions, and while
5!:5<'times'  (resstg in the caller) is a single line, 5!:5<'TImes' is
not.

The solution (assuming we want to solve this, but I can't think of any
reason why we would not) would probably be to use 0!:101 instead of ".
here.

Thanks,

-- 
Raul

On Tue, Oct 8, 2019 at 6:03 PM Ben Gorte <[email protected]> wrote:
>
> Good morning,
>
> It looks like something crept back into math/calculus.
>
> Ddot =: pderiv_jcalculus_
>
>
> times =: 4 : 0
>
> x*y
>
> )
>
>  3&times Ddot 1 (4)
>
> 3
>
>
> NB. So far, so good. But now:
>
>
> times =: 4 : 0
>
> res =: x * y
>
> res
>
> )
>
> 3&times Ddot 1 (4)
>
> |spelling error
>
> | Xvcv98df9d =. 3&(4 : 0)
>
> res =: x * y
>
> res
>
> )
>
> | ^
>
> | ".'Xvcv98df9d =. ',u
>
>
>
> Greetings,
>
> Ben
> ----------------------------------------------------------------------
> 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