<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Helvetica, Arial, sans-serif">Hi,<br>
<br>
I believe the reason why<font face="Courier New, Courier,
monospace"><b> 'a' </b></font>is scalar and <font
face="Courier New, Courier, monospace"><b>'abc'</b></font> is
not is the same as why <font face="Courier New, Courier,
monospace"><b>1</b></font> is a scalar and <font face="Courier
New, Courier, monospace"><b>1 2 3</b> </font>is not.<br>
<br>
It is very consistent, but often very inconvenient. And in
practice it is often a pitfall for the unaware programmer.<br>
I fooled myself a couple of times and then decided to introduce <font
face="Courier New, Courier, monospace"><b>"a"</b></font> which
avoids the problems with <font face="Courier New, Courier,
monospace"><b>'a'</b></font>.<br>
<br>
Before <font face="Courier New, Courier, monospace"><b>"a"</b></font>
you had to <font face="Courier New, Courier, monospace"><b>(,'a')</b></font>
or <font face="Courier New, Courier, monospace">,'a'</font> if
circumstances allowed (introducing other traps, of course).<br>
<br>
/// Jürgen<br>
<br>
</font><br>
<div class="moz-cite-prefix">On 03/03/2017 06:57 PM, <a class="moz-txt-link-abbreviated" href="mailto:***@gmx.com">***@gmx.com</a>
wrote:<br>
</div>
<blockquote cite="mid:***@gmx.com"
type="cite">
<pre wrap="">thank you - fantastic ...it sure 'fixes' the inconsistency i had no idea about "a"
I saw the use of " only in the FILE_IO "r" in the apl.html but thought that was related to just fopen/bash/c syntax
---
Do you know the 'details' about why iverson did this to begin with?
How did you deal with scalar 'a' before the "a" in gnuap?
didn't you have 'wasted code' to deal with the following to deal with scalar 'a'
⍴'a'
''=⍴'a'
⍴⍴'a'
0
---
the video in case you hadn't seen it
# APL 1991 Conference.mpg 1 hour, 50 minutes
<a class="moz-txt-link-freetext" http://youtu.be/uZOZYYPmUnM
---
On Sat, 4 Mar 2017 01:37:18 +0800
Elias Mårtenson <a class="moz-txt-link-rfc2396E" href="mailto:***@gmail.com"><***@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">In GNU APL, try this instead :
"a"[1]
The reason this seems inconsistent is because single quote is used to
define a string, i.e. an array of characters. Except the case where there
is only a single character, in which case it represents a scalar
character.
GNU APL allows you to use double quote instead which doesn't have this
inconsistency.
That should make things a bit more clear, I hope.
Regards,
Elias
On 4 Mar 2017 01:29, <a class="moz-txt-link-rfc2396E" href="mailto:***@gmx.com"><***@gmx.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">
i just watched a great video on apl and this was discussed i still
don't know what the harm/problem would be if instead of returning 'nothing'
⍴'a' why doesn't it return 1 - there is something
there please don't mention scalar i know all about it - but to me this
has always been an inconsistency in apl that made no sense to me
⍴'aa' the , isn't required in ⍴,'aa' to be
consistent ??
2
⍴,'a'
1
'a'[1]
RANK ERROR
'a'[1]
^ ^
'ab'[1]
a
(,'a')[1]
a
under what condition would 'a'[1] returning 'a' be a problem?
</pre>
</blockquote>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
</body>
</html>