View this page "Potential Changes to Bertrand"

25 views
Skip to first unread message

wm

unread,
Feb 13, 2009, 5:28:48 PM2/13/09
to Bertrand Constraint Programming Language
Since a couple of people have expressed interest in reimplementing
Bertrand in some other language (something I would love to see) I
thought it would be a good idea to write down some of the things I
might change about Bertrand if I were reimplementing it.

Click on http://groups.google.com/group/bertrand-constraint/web/potential-changes-to-bertrand
- or copy & paste it into your browser's address bar if that doesn't
work.

Nat

unread,
Feb 23, 2009, 5:32:09 PM2/23/09
to Bertrand Constraint Programming Language
You say that you want to "find a better syntax for declaring
operators".

Would it be possible to drop operator precedence altogether?

I'm sure it's because I'm new to the language but I find it fiddly to
use operator precedence to define functions. I find that I need to
know the precedence of all the operators to read and write the code.
Getting the precedence right seems fragile. My code depends on magic
numbers defined in libraries that might change underneath me. Are
there conventions or idioms that make defining operators easier?

It also makes writing tools that process the language difficult,
because a parser has to interpret each preprocessor directives to the
text that follows.

I'm imagining a syntax something like Smalltalk, with postfix and
infix operators and keyword/argument lists. So, I could define a
function like:

take n'constant of x,xs { x, (take n-1 of xs) }

without needing to define multiple operators before I can define the
rule.

--Nat

On Feb 13, 10:28 pm, wm <wmle...@gmail.com> wrote:
> Since a couple of people have expressed interest in reimplementing
> Bertrand in some other language (something I would love to see) I
> thought it would be a good idea to write down some of the things I
> might change about Bertrand if I were reimplementing it.
>
> Click onhttp://groups.google.com/group/bertrand-constraint/web/potential-chan...

wm

unread,
Feb 25, 2009, 1:28:32 AM2/25/09
to Bertrand Constraint Programming Language
Anything is possible!

And your dislike of the current operator definitions is probably not
because you are new to Bertrand. It is a bit fiddly.

wm

unread,
Jul 24, 2009, 2:08:57 AM7/24/09
to Bertrand Constraint Programming Language
I'm learning Pure, and it is making me think of other possible
improvements to Bertrand, so I updated this document:

Click on http://groups.google.com/group/bertrand-constraint/web/potential-changes-to-bertrand
Reply all
Reply to author
Forward
0 new messages