Options with Variant ⍠

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

Options with Variant ⍠

Postby petermsiegel on Tue Jun 19, 2018 3:06 am

Any thought about opening up the use of Variant ⍠ with user-defined functions?

(Myplot ⍠ ‘Title’ ‘my plot title’ ⍠ ‘missing’ ¯1) xvals yvals

or even with Perl-esque syntactic sugar (where the magical behaviour of such a → may offend syntax purists)

(Myplot ⍠ Title → ‘my plot title’ ⍠ missing → ¯1) xvals yvals

How about with built-ins like iota?

(⍳⍠⎕IO → 1) 100 ⍝ {⎕IO ← 1 ⋄ ⍳⍵} 100
Posts: 52
Joined: Thu Nov 11, 2010 11:04 pm

Re: Options with Variant ⍠

Postby Richard|Dyalog on Tue Jul 10, 2018 12:21 pm

Peter - apologies for not responding to this sooner.

Yes - variant was designed with the expectation it would be applied to more and more functions in future, including user-defined ones. When it was first being put together we also produced a "Conference Edition" release of Dyalog for the 2011 User Meeting, in order to demonstrate some experimental functionality including variant support on iota (both monadic and dyadic), though its reception was "mixed". Indeed, variant is in general quite divisive - I am keen on it, but some (both within Dyalog and without) are not and even though the idea of extending it to user functions does resurface from time to time, I cannot give any promise we will ever do it. If we did, I would not expect any change in the existing syntax.
User avatar
Posts: 34
Joined: Thu Oct 02, 2008 11:11 am

Re: Options with Variant ⍠

Postby kai on Tue Jul 10, 2018 2:10 pm

And I sit here and wait patiently for it to arrive!

Okay then: I want it, all, and now!
User avatar
Posts: 92
Joined: Thu Jun 18, 2009 5:10 pm
Location: Stevenage, UK

Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest