Help response not quite as expected
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
Help response not quite as expected
If I click F1 at the indicated point in this line
https://social.msdn.microsoft.com/Searc ... ?query=FIX
If I insert a redundant blank between the colon and quad
I've long wished that Dyalog would insert that redundant blank after a colon on grounds of æsthetics alone. Now I have another cause.
t=':':⎕FIX r↓dmy attention is inadvertently drawn to
^
https://social.msdn.microsoft.com/Searc ... ?query=FIX
If I insert a redundant blank between the colon and quad
t=':': ⎕FIX r↓dI see the "Fix script" page of Dyalog APL Help which in truth is what I'd rather see.
^
I've long wished that Dyalog would insert that redundant blank after a colon on grounds of æsthetics alone. Now I have another cause.
-
Phil Last - Posts: 628
- Joined: Thu Jun 18, 2009 6:29 pm
- Location: Wessex
Re: Help response not quite as expected
I've long wished that Dyalog would insert that redundant blank after a colon on grounds of aesthetics alone. Now I have another cause.
I like Phil's idea. I can't see the change to the result of ⎕CR breaking anyone's code (but I've been wrong before).
- JohnS|Dyalog
Re: Help response not quite as expected
Inserting a blank after the colon won't break my code, but the effect would be less pleasing aesthically, in some cases. When the dfn is one line, blanks have extra aesthetic significance. For example:
For multi-line dfns, I would agree with having a blank after the colon, again on aesthetic grounds.
Q←{1≥≢⍵:⍵ ⋄ (∇ ⍵⌿⍨0>s)⍪(⍵⌿⍨0=s)⍪∇ ⍵⌿⍨0<s←⍵ ⍺⍺ ⍵⌷⍨?≢⍵}
For multi-line dfns, I would agree with having a blank after the colon, again on aesthetic grounds.
- Roger|Dyalog
- Posts: 238
- Joined: Thu Jul 28, 2011 10:53 am
Re: Help response not quite as expected
The complete solution would be to preserve all white space in code as typed. However, whenever we have discussed this, we wound up keeping two copies of the code: one source and one tokens. Some of our users tell us that this would represent an unacceptable increase in code size.
An alternative might be to use one additional byte per guard as a count of how many blanks to preserve between the colon and the next token to its right (max 255). Then we could see:
An alternative might be to use one additional byte per guard as a count of how many blanks to preserve between the colon and the next token to its right (max 255). Then we could see:
dice←{or
⍵≡6 6: 'Box Cars'
⍵≡1 1: 'Snake Eyes'
=/⍵: 'Pair'
7=+/⍵: 'Seven'
'Unlucky'
}
dice←{and
⍵≡6 6: 'Box Cars'
⍵≡1 1: 'Snake Eyes'
=/⍵: 'Pair'
7=+/⍵: 'Seven'
'Unlucky'
}
Q←{1≥≢⍵:⍵ ⋄ (∇ ⍵⌿⍨0>s)⍪(⍵⌿⍨0=s)⍪∇ ⍵⌿⍨0<s←⍵ ⍺⍺ ⍵⌷⍨?≢⍵}
- JohnS|Dyalog
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