Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
extend parser to allow single quotes in variable names (or: "let's confuse the text editors!")
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Motiejus Jakštys  
View profile  
 More options Oct 7 2012, 12:36 pm
From: Motiejus Jakštys <desired....@gmail.com>
Date: Sun, 7 Oct 2012 17:35:44 +0100
Local: Sun, Oct 7 2012 12:35 pm
Subject: [erlang-questions] extend parser to allow single quotes in variable names (or: "let's confuse the text editors!")
Hi,

In Haskell you can have variable names with single quotes. Imagine for a
moment you are in a perfect world:

oops() ->
    A = 1024,
    A' = math:log(A) / math:log(2),
    io:format("Wow! ~p~n", [A']).

What would you think about this extension?

Regards,
Motiejus
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard O'Keefe  
View profile  
 More options Oct 7 2012, 5:45 pm
From: "Richard O'Keefe" <o...@cs.otago.ac.nz>
Date: Mon, 8 Oct 2012 10:44:45 +1300
Local: Sun, Oct 7 2012 5:44 pm
Subject: Re: [erlang-questions] extend parser to allow single quotes in variable names (or: "let's confuse the text editors!")

On 8/10/2012, at 5:35 AM, Motiejus Jakštys wrote:

> Hi,

> In Haskell you can have variable names with single quotes. Imagine for a
> moment you are in a perfect world:

> oops() ->
>    A = 1024,
>    A' = math:log(A) / math:log(2),
>    io:format("Wow! ~p~n", [A']).

> What would you think about this extension?

I would think it was pointless.

Haskell                 Erlang
x                       X
x'                      X1
x''                     X2
x'''                    X3
x''''                   X4
x'''''                  X5

Spot the pattern?

Haskell (or at least GHC) allows primes inside identifiers too,
but nobody seems to take advantage of that.

Consider f'x 'y'.  Want to read _that_ fast?
Consider f'x' y'.  Want to tell them apart fast?

SML also allows primes inside and at the end of identifiers.
This is much less of a pain in SML because SML writes
character literals as #"x" rather than 'x'.

There is historically and in good typography a clearly visible
distinction between the apostrophe and the superscript I II III
IV V: (x' is x prime; x'' is x second; x''' is x third, and
the next one is x<sup><small>IV</small></sup>, x fourth, not
x'''').  It's only the limitations of old typewriters and ASCII
that lead us to confuse them.  Superscript Roman numerals in
Unicode identifiers, fine; using the apostrophe as the quote
character for atoms and also in identifiers, not fine.

_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Motiejus Jakštys  
View profile  
 More options Oct 7 2012, 5:50 pm
From: Motiejus Jakštys <desired....@gmail.com>
Date: Sun, 7 Oct 2012 22:50:02 +0100
Local: Sun, Oct 7 2012 5:50 pm
Subject: Re: [erlang-questions] extend parser to allow single quotes in variable names (or: "let's confuse the text editors!")

Whoosh! This reasoning is just perfect. I never want to see code like
this. Thanks.

Motiejus
_______________________________________________
erlang-questions mailing list
erlang-questi...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »