discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Fwd: Re: Both kinds of quotes?

RW
Raymond West
Thu, Sep 29, 2022 7:51 PM

afaik, computer keyboards do not distinguish between apostrophes and
single quotes (they do not distinguish between opening and closing
quotes, either) . So, at the moment in openscad, to represent a double
quote within a text string, then it isalways preceded by a backslash.
However, if a single quote was accepted as well as a double quote for
string delimiters, then we would have to use a backslash to delimit
every apostrophe, which would need a different mind set, and would
probably produce errors in existing scripts.

Currently, we could have something like 'echo("George said 'Fred's
height'" = h); ' which is quite readable in both the script and the
console text

compared to possibly 'echo('George said "Fred's height"' = h);'    
(although I don't think I would use openscad to write a story...

'(If it isn't broken, lets fix it until it is)'

On 29/09/2022 12:58, jon wrote:

Now THAT statement makes no sense to me.  Adding the single quote does
not affect any code, so why does this suggestion annoy you?  Others
have made good points about preserving the ability to distinguish
between strings and characters (or some other kind of data), but you
raise an objection without providing a good reason for that objection.

On 9/29/2022 7:55 AM, edmund ronald wrote:

Don't get ticked off by my intervention, but can't we just leave well
enough alone here?

On Thu, Sep 29, 2022 at 1:52 PM jon jon@jonbondy.com wrote:

 I would welcome being allowed to use either "'" or '"' as string
 quote
 delimiters.


 On 9/29/2022 2:21 AM, Rogier Wolff wrote:

On Wed, Sep 28, 2022 at 08:25:24PM -0700, Jordan Brown wrote:

I don't come up with many downsides, and I come up with a

 couple of

minor upsides:

    * Similarity to other popular languages
    * Can naturally embed one within the other; you can write

 "it's" or

      you can write 'these are "scare" quotes'
    * Don't have to shift to type a quoted string

It is an easy way to allow for future expansion with another
string/character type by using the other quote. Like in C where
'a' is the character a (97) and "a" is a string (a pointer to
97, 0 in memory).

       Roger.

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org

OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

afaik, computer keyboards do not distinguish between apostrophes and single quotes (they do not distinguish between opening and closing quotes, either) . So, at the moment in openscad, to represent a double quote within a text string, then it is*always* preceded by a backslash. However, if a single quote was accepted as well as a double quote for string delimiters, then we would have to use a backslash to delimit every apostrophe, which would need a different mind set, and would probably produce errors in existing scripts. Currently, we could have something like 'echo("George said 'Fred's height'" = h); ' which is quite readable in both the script and the console text compared to possibly 'echo('George said "Fred\'s height"' = h);'     (although I don't think I would use openscad to write a story... '(If it isn\'t broken, lets fix it until it is)' On 29/09/2022 12:58, jon wrote: > > Now THAT statement makes no sense to me.  Adding the single quote does > not affect any code, so why does this suggestion annoy you?  Others > have made good points about preserving the ability to distinguish > between strings and characters (or some other kind of data), but you > raise an objection without providing a good reason for that objection. > > On 9/29/2022 7:55 AM, edmund ronald wrote: >> Don't get ticked off by my intervention, but can't we just leave well >> enough alone here? >> >> On Thu, Sep 29, 2022 at 1:52 PM jon <jon@jonbondy.com> wrote: >> >> I would welcome being allowed to use either "'" or '"' as string >> quote >> delimiters. >> >> >> On 9/29/2022 2:21 AM, Rogier Wolff wrote: >> > On Wed, Sep 28, 2022 at 08:25:24PM -0700, Jordan Brown wrote: >> >> I don't come up with many downsides, and I come up with a >> couple of >> >> minor upsides: >> >> >> >>    * Similarity to other popular languages >> >>    * Can naturally embed one within the other; you can write >> "it's" or >> >>      you can write 'these are "scare" quotes' >> >>    * Don't have to shift to type a quoted string >> > It is an easy way to allow for future expansion with another >> > string/character type by using the other quote. Like in C where >> > 'a' is the character a (97) and "a" is a string (a pointer to >> > 97, 0 in memory). >> > >> >       Roger. >> > >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email todiscuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
AM
Adrian Mariano
Thu, Sep 29, 2022 8:25 PM

That's not how it works.  If the proposed change occurred, then you could
still write

echo("George said 'Fred's height'" = h)

You could alternately write

echo ('George said 'Fred's height'' = h)

but why would you do that?

To me, the main reason to favor the proposal is that it eliminates
backslashes for producing output with " characters, which I do quite a bit,
and usually I make some error with the number and placement of backslashes
and quote characters and have to go back and fix it.  So it would be a
minor improvement for that reason---I'd call it more than
"microscropic"---but it doesn't seem like a big issue to me.

On Thu, Sep 29, 2022 at 3:52 PM Raymond West raywest@raywest.com wrote:

afaik, computer keyboards do not distinguish between apostrophes and
single quotes (they do not distinguish between opening and closing quotes,
either) . So, at the moment in openscad, to represent a double quote within
a text string, then it is* always* preceded by a backslash. However, if a
single quote was accepted as well as a double quote for string delimiters,
then we would have to use a backslash to delimit every apostrophe, which
would need a different mind set, and would probably produce errors in
existing scripts.

Currently, we could have something like 'echo("George said 'Fred's
height'" = h); ' which is quite readable in both the script and the console
text

compared to possibly 'echo('George said "Fred's height"' = h);'
(although I don't think I would use openscad to write a story...

'(If it isn't broken, lets fix it until it is)'

On 29/09/2022 12:58, jon wrote:

Now THAT statement makes no sense to me.  Adding the single quote does not
affect any code, so why does this suggestion annoy you?  Others have made
good points about preserving the ability to distinguish between strings and
characters (or some other kind of data), but you raise an objection without
providing a good reason for that objection.
On 9/29/2022 7:55 AM, edmund ronald wrote:

Don't get ticked off by my intervention, but can't we just leave well
enough alone here?

On Thu, Sep 29, 2022 at 1:52 PM jon jon@jonbondy.com wrote:

I would welcome being allowed to use either "'" or '"' as string quote
delimiters.

On 9/29/2022 2:21 AM, Rogier Wolff wrote:

On Wed, Sep 28, 2022 at 08:25:24PM -0700, Jordan Brown wrote:

I don't come up with many downsides, and I come up with a couple of
minor upsides:

* Similarity to other popular languages
* Can naturally embed one within the other; you can write "it's" or
  you can write 'these are "scare" quotes'
* Don't have to shift to type a quoted string

It is an easy way to allow for future expansion with another
string/character type by using the other quote. Like in C where
'a' is the character a (97) and "a" is a string (a pointer to
97, 0 in memory).

   Roger.

OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

That's not how it works. If the proposed change occurred, then you could still write echo("George said 'Fred's height'" = h) You could alternately write echo ('George said \'Fred\'s height\'' = h) but why would you do that? To me, the main reason to favor the proposal is that it eliminates backslashes for producing output with " characters, which I do quite a bit, and usually I make some error with the number and placement of backslashes and quote characters and have to go back and fix it. So it would be a minor improvement for that reason---I'd call it more than "microscropic"---but it doesn't seem like a big issue to me. On Thu, Sep 29, 2022 at 3:52 PM Raymond West <raywest@raywest.com> wrote: > > afaik, computer keyboards do not distinguish between apostrophes and > single quotes (they do not distinguish between opening and closing quotes, > either) . So, at the moment in openscad, to represent a double quote within > a text string, then it is* always* preceded by a backslash. However, if a > single quote was accepted as well as a double quote for string delimiters, > then we would have to use a backslash to delimit every apostrophe, which > would need a different mind set, and would probably produce errors in > existing scripts. > > Currently, we could have something like 'echo("George said 'Fred's > height'" = h); ' which is quite readable in both the script and the console > text > > compared to possibly 'echo('George said "Fred\'s height"' = h);' > (although I don't think I would use openscad to write a story... > > '(If it isn\'t broken, lets fix it until it is)' > > > On 29/09/2022 12:58, jon wrote: > > Now THAT statement makes no sense to me. Adding the single quote does not > affect any code, so why does this suggestion annoy you? Others have made > good points about preserving the ability to distinguish between strings and > characters (or some other kind of data), but you raise an objection without > providing a good reason for that objection. > On 9/29/2022 7:55 AM, edmund ronald wrote: > > Don't get ticked off by my intervention, but can't we just leave well > enough alone here? > > On Thu, Sep 29, 2022 at 1:52 PM jon <jon@jonbondy.com> wrote: > >> I would welcome being allowed to use either "'" or '"' as string quote >> delimiters. >> >> >> On 9/29/2022 2:21 AM, Rogier Wolff wrote: >> > On Wed, Sep 28, 2022 at 08:25:24PM -0700, Jordan Brown wrote: >> >> I don't come up with many downsides, and I come up with a couple of >> >> minor upsides: >> >> >> >> * Similarity to other popular languages >> >> * Can naturally embed one within the other; you can write "it's" or >> >> you can write 'these are "scare" quotes' >> >> * Don't have to shift to type a quoted string >> > It is an easy way to allow for future expansion with another >> > string/character type by using the other quote. Like in C where >> > 'a' is the character a (97) and "a" is a string (a pointer to >> > 97, 0 in memory). >> > >> > Roger. >> > >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >