-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
bugThings not working as they should.Things not working as they should.
Description
>>> import operator
>>> from pynapl import APL
>>> apl = APL.APL()
>>> dot_ = apl.op(".+")
>>> dot_(operator.mul)([1, 2, 3], [1, 2, 3])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\rodri\Documents\Dyalog\pynapl\pynapl\APLPyConnect.py", line 307, in __fn
if len(args)==2: return self.eval("(⊃∆)(%s)2⊃∆"%aplfn, args[0], args[1], raw=raw)
File "C:\Users\rodri\Documents\Dyalog\pynapl\pynapl\APLPyConnect.py", line 381, in eval
raise APLError(json_obj=reply.data)
pynapl.APLPyConnect.APLError: SYNTAX ERRORThe expected behaviour would've been to compute 1 2 3 ×.+ 1 2 3. Instead, we get a SYNTAX ERROR.
This does not seem to be a shortcoming of dyadic operators in general, as we seem to be able to derive monadic operators from other dyadic operators; @ for example:
>>> from pynapl import APL
>>> apl = APL.APL()
>>> # Array right operand
>>> at_first = apl.op("@1")
>>> at_first(lambda *_: 73)([1, 2, 3, 4])
[73, 2, 3, 4]
>>> at_first(lambda n: n + 3)([1, 2, 3, 4])
[4, 2, 3, 4]
>>> # Function right operand
>>> at_self = apl.op("@⊢")
>>> at_self(lambda *_: 73)([1, 0, 1, 0, 0, 1, 1])
[73, 0, 73, 0, 0, 73, 73]Probably related to the special casing mentioned in #9.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugThings not working as they should.Things not working as they should.