Wish List: Support for Double Quotes

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 !
Post Reply
User avatar
PGilbert
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Wish List: Support for Double Quotes

Post by PGilbert »

It would be nice if Dyalog was able to support double quotes.

      A←'It''s raining, isn''t it?'
A
It's raining, isn't it?

B←"It's raining, isn't it?"
B
It's raining, isn't it?

A≡B
1


Pierre Gilbert
User avatar
Morten|Dyalog
Posts: 460
Joined: Tue Sep 09, 2008 3:52 pm

Re: Wish List: Support for Double Quotes

Post by Morten|Dyalog »

We have been reserving double quotes for a scalar string type (which is implemented by APL#, and may be added to Dyalog APL in the future):

"Hello" "World" = "Hello"
1 0

≡"Hello" "World"
1
User avatar
PGilbert
Posts: 440
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: Wish List: Support for Double Quotes

Post by PGilbert »

Thanks for the education Morten, I would have thought that a simple thing like double quotes would be implemented equally between APL providers but looks like its not the case (APL+Win and APLX support the double quote has explained above) and I am sure your reasons are as valid are the ones of the other APL providers.
rex
Posts: 12
Joined: Sat Jun 10, 2023 10:49 pm
Contact:

Re: Wish List: Support for Double Quotes

Post by rex »

Still no progress on this?

In most other APLs, I can say
  A←"Don't"

This would be an issue when migrating from APL+Win to Dyalog.
User avatar
Morten|Dyalog
Posts: 460
Joined: Tue Sep 09, 2008 3:52 pm

Re: Wish List: Support for Double Quotes

Post by Morten|Dyalog »

I'm not sure the "most other APL's" statement is entirely accurate. APL+Win supports this but the implementors did not (as far as I know) consult other vendors when doing it. APLX, which was very much a clone of APL+Win at the language level, followed suit, but I am not aware of other APL systems that behave exactly the same way.

It remains our opinion that this was a bad design choice; there are better potential uses for the double quote and we are not ready to burn this bridge for short-term gain.

We're working on semi-automatic conversion tools for APL+Win code which will be able to handle most common cases of this, including your example. It gets tricky if people are building strings to throw at ⍎ or ⎕FX, but in the APL+Win application I am working on converting right now, that affects 1 out of 3,000 functions.

P.S. I just learned there is a web page where you can search for differences between array languages: Go to https://omnibar.rubenverg.com/ and enter " in the search field.
rex
Posts: 12
Joined: Sat Jun 10, 2023 10:49 pm
Contact:

Re: Wish List: Support for Double Quotes

Post by rex »

Yeah, I guess "most" is vague.
I did check, and Bob Smith's NARS2000 supports double-quotes.
Do you know of APLs beside Dyalog that do not support them?
User avatar
Morten|Dyalog
Posts: 460
Joined: Tue Sep 09, 2008 3:52 pm

Re: Wish List: Support for Double Quotes

Post by Morten|Dyalog »

rex wrote:Do you know of APLs beside Dyalog that do not support them?
IBM/LOGON APL2 does not, and although GNU APL and a couple of experimental APLs support double quotes, they do not define them the same way as APL+Win: A double-quoted string is aways a vector, and can contain "escaped" characters.

If we were to start using double quotes, we would either follow that track, or use them to define an atomic string data type for interop with languages which distinguish between strings and lists of characters.
Post Reply