Displaying APL fns with explicit axes
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 !
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 !
4 posts
• Page 1 of 1
Displaying APL fns with explicit axes
This short fn def works just fine, but I was surprised to see the axis displayed without the closing bracket:
For reference, here's the environment:
cat0←,[0] ⍝ In real life, the axis number is dynamically set.I couldn't find a reference to the intended display form (though it's hard to search for usefully). I am guessing there's an error in the C display code. Or, is this pedagogical oddity expected?
cat0
,[ 0
For reference, here's the environment:
)clear
clear ws
]version
Dyalog 18.0.39712 64-bit Unicode, BuildID 1db3fcb9
OS Darwin 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
SALT 2.808, Link: 2.0.6
UCMD 2.4
.NET .NET Core 3.1.5
WS 18.0
- petermsiegel
- Posts: 143
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Displaying APL fns with explicit axes
Thank you for bringing attention to this.
Note that the default display form of derived functions (and for that sake arrays too) is not intended to (necessarily) be executable. The idea here is that [ has the role of a dyadic operator, with ] only being an auxiliary symbol.
That said, it is easy to see how this display form can be confusing, and so in 18.1 it will include the ] when boxing is on. If you want the default non-boxed display of arrays, you can still obtain an improved display of derived functions with
Note that the default display form of derived functions (and for that sake arrays too) is not intended to (necessarily) be executable. The idea here is that [ has the role of a dyadic operator, with ] only being an auxiliary symbol.
That said, it is easy to see how this display form can be confusing, and so in 18.1 it will include the ] when boxing is on. If you want the default non-boxed display of arrays, you can still obtain an improved display of derived functions with
]box on -s=non -t=parens
-
Adam|Dyalog - Posts: 135
- Joined: Thu Jun 25, 2015 1:13 pm
Re: Displaying APL fns with explicit axes
Thank you. Depending on the ]box setting, there's an extra space between the derived function ,[ and the dimension 0. It's just a distraction, except perhaps for those learning.
- Code: Select all
a←,[0]
a
,[ 0
]box on -s=mid -tr=parens
Was OFF -style=min -trains=box
a
,[0
- petermsiegel
- Posts: 143
- Joined: Thu Nov 11, 2010 11:04 pm
Re: Displaying APL fns with explicit axes
The space will only appear when boxing is completely off. It doesn't appear with boxing on, even when -style=non
-
Adam|Dyalog - Posts: 135
- Joined: Thu Jun 25, 2015 1:13 pm
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group