Differences between revisions 9 and 10
Revision 9 as of 2009-12-31 10:13:48
Size: 2666
Editor: SimonMarsden
Comment:
Revision 10 as of 2009-12-31 10:14:51
Size: 2707
Editor: SimonMarsden
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 (@``SIG``@)|| || 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)>>)||

Left, Right, or the Same?

Something that was talked about at the November 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".

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)

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.

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 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.

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.

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)