Page 1 of 1

Progress on version 3?

Posted: Fri May 14, 2010 2:55 pm
by kerravonsen
Dare I ask how the work on version 3 is going? It is mentioned frequently enough that it is obviously "coming soon". Though of course the value of "soon" could be anything from months to years. Any estimates?

Re: Progress on version 3?

Posted: Sat May 15, 2010 5:51 pm
by MtnViewJohn
I thought that I would have a beta release out by now, but life got in the way. Most of the features are implemented except for rule parameters. I've written an external reference spec here. I'm not satisfied with the syntax for the new features yet. I think that the syntax is too verbose. I also haven't implemented the conditional code feature because I don't like the syntax.

Re: Progress on version 3?

Posted: Sat May 15, 2010 6:57 pm
by kerravonsen
I also haven't implemented the conditional code feature because I don't like the syntax.

The long version of the conditional code feature looks like a "case" or a "switch" statement - perhaps one could render it less verbose by borrowing the syntax of bash or C for that?
Though with those, the "switch" is testing against a single value, so it probably isn't the best idea after all.

What is bothering you about the syntax of the conditional code feature?

Re: Progress on version 3?

Posted: Sat May 15, 2010 10:05 pm
by MtnViewJohn
The proposed select statement is a functional superset of the C language if-then-else and switch-case statements. But this generalized nature comes at a cost, the user is required to type in more text.

Instead of typing

Code: Select all

if (foo < 3) 
  CIRCLE{} 
else 
  SQUARE{}
they have to type

Code: Select all

select {
  if (foo < 3) CIRCLE {}
  else SQUARE {}
} 
And instead of

Code: Select all

switch(floor(rand(3)) {
  case 0: CIRCLE {}
  case 1: SQUARE {}
  case 2: TRIANGLE {}
  default: Ouroboros{}
} 
they have to type

Code: Select all

shapeType = floor(rand(3));
select {
  if (shapeType == 0) CIRCLE{}
  if (shapeType == 1) SQUARE{}
  if (shapeType == 2) TRIANGLE{}
  else Ouroboros{}
} 
I thought I would keep things simple for myself by having a single conditional code syntax that supports if-then-else-type code and switch-case-type code. But users end up having to type more keywords and symbols and their code isn't as clear. So I should probably make things simple for users by having if-then-else statements and switch statements.