Progress on version 3?

Here you can discuss and share functionality improvements and helper programs to make Context Free better.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
kerravonsen
Posts: 2
Joined: Mon May 03, 2010 2:33 am

Progress on version 3?

Post 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?

User avatar
MtnViewJohn
Site Admin
Posts: 875
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Progress on version 3?

Post 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.

User avatar
kerravonsen
Posts: 2
Joined: Mon May 03, 2010 2:33 am

Re: Progress on version 3?

Post 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?

User avatar
MtnViewJohn
Site Admin
Posts: 875
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Progress on version 3?

Post 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.

Post Reply