Google Groups Home Help | Sign in
Identifiers
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
  2 messages - Collapse all
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
Bryan.Burgers@gmail.com  
View profile
(1 user)  More options Apr 17 2007, 1:27 pm
From: "Bryan.Burg...@gmail.com" <Bryan.Burg...@gmail.com>
Date: Tue, 17 Apr 2007 17:27:42 -0000
Local: Tues, Apr 17 2007 1:27 pm
Subject: Identifiers
Hello,

I've been playing around with Cat a little bit recently, and I have a
few comments, but I'll just start out with just this one question.

In your grammar, you have the following rules:

identifer ::==
      alphanum+ |
      group_symbol* |
      single_symbol |

group_symbol ::==
      [~,#,$,%,^,&,*,-,+,=,|,\,:,;,<,>,.,?,/]

alphanum ::==
      letter |
      number

I'm wondering if there is any reason that 'alphanum' and
'group_symbol' are kept separate in the identifier. I would think
since, by the nature of stack languages, there are no infix symbols,
there would be no need to keep these separate. Take, for example
Scheme, which also has no infixes; in Scheme you can name things "my
+function" or "|->i*i<-|", or a non-contrived example, "call-with-
current-continuation". Is there any reason for not allowing this is
Cat?

As an example, say somebody would someday want to write an html
library, they could do something like:

define <p> { "<p>" }
define </p> { cat_str "</p>" cat_str }

So the following code:

<p> "This is in my paragraph" </p>

Yields:

"<p>This is in my paragraph</p>"

I think it gives just a little bit more freedom in name identifiers.
Just curious,

Bryan Burgers


    Reply to author    Forward  
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.
Christopher Diggins  
View profile
 More options Apr 17 2007, 6:34 pm
From: "Christopher Diggins" <cdigg...@gmail.com>
Date: Tue, 17 Apr 2007 15:34:36 -0700
Local: Tues, Apr 17 2007 6:34 pm
Subject: Re: Identifiers
As far as I can tell Bryan, that is an excellent idea! I was used to
the C syntax of not requiring whitespace, i+=1 which to be honest, I
never used, and abhor looking at. Besides as you point out, it isn't
really neccessary in a stack-based language.

I will spend a couple of days mulling it over, but will probably add
the feature in the release after next.

Thanks for the suggestion!
Christopher Diggins

On 4/17/07, Bryan.Burg...@gmail.com <Bryan.Burg...@gmail.com> wrote:


    Reply to author    Forward  
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 »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google