Differences between revisions 14 and 15
Revision 14 as of 2009-12-31 11:30:09
Size: 3251
Editor: SimonMarsden
Comment:
Revision 15 as of 2009-12-31 13:36:42
Size: 3287
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 12: Line 12:
Could someone explain how lev and dex differ from the APL2 implementation? We just added APL2-compatible support for ⊣ and ⊢ in APLX Version 5. Sounds wrong to have an incompatible implementation in Dyalog if it can be avoided (-- SimonMarsden <<DateTime(2009-12-31T10:14:51Z)>>)   Could someone explain how lev and dex differ from the APL2 implementation? We just added APL2-compatible support for ⊣ and ⊢ in APLX Version 5. Sounds wrong to have an incompatible implementation in Dyalog if it can be avoided (-- SimonMarsden <<DateTime(2009-12-31T10:14:51Z)>>)
Line 14: Line 14:
As I hinted, APL2's  ⎕L and ⎕R are something completely different (hiding under a similar name) - I don't think APL2 recognises the ⊣ and ⊢ characters (I just got a SYNTAX ERROR when I tried 2 ⊣ 3 (APL2 V2 SL 14 on Windows 7)
(-- DickBowman <<DateTime(2009-12-31T10:35:00Z)>>).
As I hinted, APL2's  ⎕L and ⎕R are something completely different (hiding under a similar name) - I don't think APL2 recognises the ⊣ and ⊢ characters (I just got a SYNTAX ERROR when I tried 2 ⊣ 3 (APL2 V2 SL 14 on Windows 7) (-- DickBowman <<DateTime(2009-12-31T10:35:00Z)>>).
Line 17: Line 16:
Thanks, Dick. You're right. I mis-remembered. I believe that ⊣ and ⊢ are part of the extended ISO APL standard (ISO/IEC13751) but it appears that APL2 doesn't implement them. (-- SimonMarsden <<DateTime(2009-12-31T11:29:45Z)>>)  Thanks, Dick. You're right. I mis-remembered. I believe that ⊣ and ⊢ are part of the extended ISO APL standard (ISO/IEC13751) but it appears that APL2 doesn't implement them. (-- SimonMarsden <<DateTime(2009-12-31T11:29:45Z)>>)
Line 24: Line 23:
Others preferred the J model, where monadic ] and monadic [ are both called "same" and do nothing. Others preferred the J model, where monadic ] and monadic [ are both called "same" and do nothing apart from return their argument as the result.
Line 29: Line 28:
While most versions of APL react to monadic + and a non-numeric argument with DOMAIN ERROR (consistent with dyadic + and non-numeric arguments), Dyalog has long allowed this case and returns the argument unchanged - it is equivalent to "same" in this case. Monadic + on an numeric argument is also an identity, for real numbers. While most versions of APL react to monadic + and a non-numeric argument with DOMAIN ERROR (consistent with dyadic + and non-numeric arguments), Dyalog has long allowed this and returns the argument unchanged - it is equivalent to "same" in this case. Monadic + on a numeric argument is also an identity, for real numbers.
Line 31: Line 30:
What makes this matter is that Dyalog might at some point introduce complex numbers, meaning that monadic + should no longer be an identity. Going forward (as we dynamic business leaders say) this ought not be a problem, because monadic "same" offers identity for all arguments. What makes this matter is that Dyalog might at some point introduce complex numbers, meaning that monadic + would no longer be an identity. Going forward (as we dynamic business leaders say) this ought not be a problem, because monadic "same" offers identity for all arguments.

Left, Right, or the Same?

Something that was talked about at the November 2009 meeting of London-based APL users was that it might be useful for the APL Wiki to contain summaries of online discussions which had happened at places like comp.lang.apl and the dyalogusers mailing list. This is a first attempt at such a summarisation, brought about by suggestions that Dyalog might introduce some new primitive functions. If you don't like it, feel free to change it - if you really don't like it, feel free to delete it.

Left, Right Dyadic Forms

Both Sharp APL and J have for some time included primitive functions which returned either their left or right arguments (unchanged). There was little contention about these dyadics aside from naming, some preferring to follow the Sharp APL "lev" and "dex", others preferring J's "left" and "right".

The symbols proposed are ⊣ and ⊢ respectively.

Notice that these functions are quite different from APL2's "left" and "right".

Discussion

Could someone explain how lev and dex differ from the APL2 implementation? We just added APL2-compatible support for ⊣ and ⊢ in APLX Version 5. Sounds wrong to have an incompatible implementation in Dyalog if it can be avoided (-- SimonMarsden 2009-12-31 10:14:51)

As I hinted, APL2's  ⎕L and ⎕R are something completely different (hiding under a similar name) - I don't think APL2 recognises the ⊣ and ⊢ characters (I just got a SYNTAX ERROR when I tried 2 ⊣ 3 (APL2 V2 SL 14 on Windows 7) (-- DickBowman 2009-12-31 10:35:00).

Thanks, Dick. You're right. I mis-remembered. I believe that ⊣ and ⊢ are part of the extended ISO APL standard (ISO/IEC13751) but it appears that APL2 doesn't implement them. (-- SimonMarsden 2009-12-31 11:29:45)

Monadic Form

Agreement on the monadic(s) was less uniform, partly because Sharp APL offered a different model from J.

Some participants preferred the Sharp model, where monadic "lev" offered a black hole into which unwanted results could be thrown.

Others preferred the J model, where monadic ] and monadic [ are both called "same" and do nothing apart from return their argument as the result.

Some participants found it hard to see much utility for the monadic form.

While most versions of APL react to monadic + and a non-numeric argument with DOMAIN ERROR (consistent with dyadic + and non-numeric arguments), Dyalog has long allowed this and returns the argument unchanged - it is equivalent to "same" in this case. Monadic + on a numeric argument is also an identity, for real numbers.

What makes this matter is that Dyalog might at some point introduce complex numbers, meaning that monadic + would no longer be an identity. Going forward (as we dynamic business leaders say) this ought not be a problem, because monadic "same" offers identity for all arguments.

But, some code exploits Dyalog's specific domain extension and may begin to fail if and when complex numbers are introduced. At this point there has been no resolution of this issue - opinions are divided about whether backward compatibility to what might be considered a design error should be adopted.


CategoryEssays

Left, Right, or the Same? (last edited 2015-02-09 20:29:13 by KaiJaeger)