Symbols for sort idioms

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 !

Re: Symbols for sort idioms

Postby Phil Last on Thu Jan 05, 2023 10:33 am

Veli-Matti wrote:Hmm..
Behind ... looked pretty interesting

This proposed syntax conjunction was one of the very first I wrote and used back in the early eighties in APL2 then in Dyalog pre dfns and very useful it is. But given that the use of the word "behind" apparently confounds the temporal with the spatial; the expectation that APL be executed Right to Left but read Left to Right:
      alfalfa behind omegamo ⍝ seems to imply we do omegamo before alfalfa
apart from the unfortunate, fundamental connotation of the name itself; I'd have thought a name such as "before" or "pre" might be more appropriate.
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: Symbols for sort idioms

Postby paulmansour on Thu Jan 05, 2023 5:42 pm

apart from the unfortunate, fundamental connotation of the name itself;


Regardless of what it does, it is a very, very bad name.
paulmansour
 
Posts: 430
Joined: Fri Oct 03, 2008 4:14 pm

Re: Symbols for sort idioms

Postby Adam|Dyalog on Fri Jan 06, 2023 10:14 am

Phil Last wrote:the use of the word "behind" apparently confounds the temporal with the spatial

When we added additional compositional operators in 18.0, we renamed the operator hitherto named Compose (∘), calling it Beside to follow the spatial theme of Atop (⍤) and Over (⍥), and indicate that the composition corresponds to the two functions being beside one another in the corresponding explicit expression. So too, Behind indicates the position in the corresponding explicit expression, with the left function being pushed behind the left argument:
      X  f⍛g  Y
(f X) g Y

One of the alternatives considered at the time was After, which is indeed temporal, but since we weren't adding a Before operator at the time, this seemed odd. I'd be happy changing the name of ∘ again, but it might also make it look like we don't know what we're doing — which might of course be the truth. :-D

Either way, I personally wouldn't put too much weight on the official names. Calling f⍛g and f∘g Before and After should be fine. After all, who calls ⍳⍵ Index Generator?
User avatar
Adam|Dyalog
 
Posts: 143
Joined: Thu Jun 25, 2015 1:13 pm

Re: Symbols for sort idioms

Postby Phil Last on Fri Jan 06, 2023 10:11 pm

The primary "arguments" to a conjunction are its operands. The name should surely indicate the relation between them rather than that between one of them and the arguments to the derivation. In this case the left one is applied (no matter to what) first i.e. before the right.

So to make explicit the sub-text from my post above (and please excuse the Anglo Saxon) surely the name "behind" is not only arse but arse-about-face.

"Before" (as opposed to "After") would indeed be a more appropriate name.
User avatar
Phil Last
 
Posts: 628
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: Symbols for sort idioms

Postby Bob Armstrong on Sun Jan 08, 2023 7:50 am

X f⍛g Y
(f X) g Y

In 4th.CoSy RPN that would be
X f Y g
so no point in more complex verbiage .
User avatar
Bob Armstrong
 
Posts: 27
Joined: Wed Dec 23, 2009 8:41 pm
Location: 39.038681° -105.079070° 2500m

Re: Symbols for sort idioms

Postby Bob Armstrong on Sun Jan 08, 2023 8:49 am

This discussion makes me think of a compiling word ' later by Helmar Wodtke , one of the heads contributing to the Reva Forth CoSy is currently built in .
Code: Select all
   ` later `( Help :?? See )` ' Eval 'R
(
 later ( -- ) 'forth
Context: ~util
Source in: src/reva.f
   This is a unique flow-control word.  What it does is return
   immediately to the calling word, and when the calling word exits,
   resumes after the 'later'.

   Example:

       : a ." in a " later ." later, dude!" ;
      : b ." in b " a ." after a " ;
      b
   Prints:
       in b in a after a later, dude!
   
See also: (while) 0do ?do again back do eleave flow-control i j leave loop more remains repeat skip unloop while
 (
  ./src/reva.f
: later inline{ 5B 59 53 51 } ;
 ) )

0061BBF8  5B                          pop ebx
0061BBF9  59                          pop ecx
0061BBFA  53                          push ebx
0061BBFB  51                          push ecx
0061BBFC  C3                          ret


Obviously the definition of ' later is trivial x86 just manipulating the return stack , but I've never used it .
User avatar
Bob Armstrong
 
Posts: 27
Joined: Wed Dec 23, 2009 8:41 pm
Location: 39.038681° -105.079070° 2500m

Previous

Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest