The Artima Developer Community
Sponsored Link

Heron-Centric: Ruminations of a Language Designer
if u cn rd ths ...
by Christopher Diggins
September 1, 2005
Summary
Since Heron syntax is C++ based, I am experimenting to see what happens when you drop the requirement for the this keyword.

Advertisement

In my attempt to mimic C++ syntax, but increase flexibility I have ended up with a legal statement which may raise eyebrows:

  * * *;
The * as a unary operator by default means *this. The * as a binary operator commonly means multiply (it maps to a function _star). So * * * will in some cases result in a square operation. This should not be confused with *** which maps to the function: _star_star_star when used as a binary operator, or to _pre_star_star_star() when used as a unary operator.

I can write the BNF rules unambiguously, but the question is, is this a very bad idea?

Talk Back!

Have an opinion? Readers have already posted 12 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Christopher Diggins adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Christopher Diggins is a software developer and freelance writer. Christopher loves programming, but is eternally frustrated by the shortcomings of modern programming languages. As would any reasonable person in his shoes, he decided to quit his day job to write his own ( www.heron-language.com ). Christopher is the co-author of the C++ Cookbook from O'Reilly. Christopher can be reached through his home page at www.cdiggins.com.

This weblog entry is Copyright © 2005 Christopher Diggins. All rights reserved.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use