bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] defining new operator


From: Fausto Saporito
Subject: Re: [Bug-apl] defining new operator
Date: Tue, 14 Apr 2015 13:38:56 +0200

Hello Jay,

I'm using emacs and gnu-apl-mode but when I try to define the operator without the space I receive an error: "unable to parse".

Generally I use emacs, cause under Mac OS X I'm not able to use the APL keyboard... I didn't find a way :-) (tried xmodmap, setxbdmap, etc).

I also tried with ]keyb (it displays correctly the APL keyboard on the screen, but I don't understand how the keys are mapped).

I tested without emacs (using copy'n'paste) and it works.

regards,
Fausto


2015-04-14 13:25 GMT+02:00 Jay Foad <address@hidden>:
You shouldn't need a space after the right parenthesis.

This works for me:

z←(F scan)x;y
z←⊂y←↑x
∆1:→(0=⍴x←1↓x)/0
z←z,⊂y←y F↑x
→∆1

      +scan 2 3 4
2 5 9

I had to:
- change " to ↓ for Drop
- use monadic ↑ instead of ⊃ for First (this is a Dyalog "migration
level" thing)
- replace modified assignment z,← with z←z,

Jay.

On 14 April 2015 at 12:06, Fausto Saporito <address@hidden> wrote:
> Hi Jürgen,
>
> thanks... my fault. I wrote without space after the right parenthesis and
> the interpret gave me an error. I.e. ∇z←(F scan)x;y
>
> I didn't notice the blank space was mandatory.
>
> regards,
> Fausto
>
>
>
> 2015-04-14 12:58 GMT+02:00 Juergen Sauermann
> <address@hidden>:
>>
>> Hi Fausto,
>>
>> page 30 (Defined Functions and Operators) explains it.
>> In your example below F is expected to be a function because it
>> is inside () in the header while the variable(s) are outside ().
>>
>> /// Jürgen
>>
>>
>> On 04/14/2015 12:42 PM, Fausto Saporito wrote:
>>
>> Hello all,
>>
>> sorry if I bother you again, but I tried to find some hints in the APL2
>> Language Reference Manual without luck.
>>
>> In the Sullivan's paper, there's the reference to a "scan" operator quite
>> fast more suited to be used with his multi precision package.
>> This is its definition:
>>
>> ∇ z←(F scan)x;y
>>
>> z←⊂y←⊃x
>> ∆1:!(0=⍴x←1"x)/0
>> z,←⊂y←y F⊃x
>> !∆1
>>
>> the "!" is the branch arrow.
>>
>> Now the problem is with GNU APL I cannot define this operator, cause I
>> don't know how to specify F is a function not a variable.
>>
>> is there a way to do that ?
>>
>> thanks,
>> fausto
>>
>>
>>
>>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]