Integrating Bertrand with other languages

25 views
Skip to first unread message

Nat

unread,
Feb 16, 2009, 4:57:19 PM2/16/09
to Bertrand Constraint Programming Language
Hi. I'm piping calculations to Bertrand from a Python/Gtk front-end
and have come across a few difficulties. I've had to modify the
Bertrand code to work around them.

Firstly, the bert executable does not return anything from main, so
the exit code on a successful calculation is random. Adding a "return
0;" statement at the end fixes that.

Secondly, both successful output and error messages are sent to the
standard error stream. I'm working around that in the Python code at
the moment but it would be much easier to pipe data into and out of
the Bertrand interpreter if output went to stdout and errors went to
stderr.

Cheers,
--Nat.

Wm Leler

unread,
Feb 16, 2009, 5:00:38 PM2/16/09
to bertrand-...@googlegroups.com
Feel free to make changes to the code!

On Thursday, I have an appointment with someone to help me learn git,
so who knows, we might have a proper source repository soon.

--wm

Nat

unread,
Feb 16, 2009, 6:45:06 PM2/16/09
to Bertrand Constraint Programming Language
Great. That will make it much easier to contribute patches.

--Nat

Igal Koshevoy

unread,
Feb 17, 2009, 3:11:24 AM2/17/09
to bertrand-...@googlegroups.com
Wm Leler wrote:
Feel free to make changes to the code!

On Thursday, I have an appointment with someone to help me learn git,  
so who knows, we might have a proper source repository soon.
That'd be great.

Say, when you're doing this, can you take a look at the changes I've made and consider incorporating them? There's a "pristine" branch which has your code as you delivered it, and "master" which contains my derivative version. My code is at http://github.com/igal/bertrand/tree/master

You've incorporated or implemented equivalents of most, but not all of my changes. The outstanding changes include:
  1. Improved prep.c file_push: Added logic to try to load a library from the current directory, the "libraries" directory, or the LIBDIR directory.
  2. "make clean" task
  3. Documentation improvements

-igal

Wm Leler

unread,
Feb 17, 2009, 6:39:41 PM2/17/09
to bertrand-...@googlegroups.com
That should be an interesting exercise, since I've made changes to my code since you updated the git repository.  I'll get to figure out how to do a merge!

--wm

Nat

unread,
Feb 18, 2009, 4:52:03 AM2/18/09
to Bertrand Constraint Programming Language
Will http://github.com/igal/bertrand/tree/master be the official
master branch? Should I start tracking this, or stick to downloading
the ZIP files for the moment?

--Nat

On Feb 17, 11:39 pm, Wm Leler <wmle...@gmail.com> wrote:
> That should be an interesting exercise, since I've made changes to my  
> code since you updated the git repository.  I'll get to figure out how  
> to do a merge!
>
> --wm
>
> On Feb 17, 2009, at 12:11 AM, Igal Koshevoy wrote:
>
> > Wm Leler wrote:
>
> >> Feel free to make changes to the code!
>
> >> On Thursday, I have an appointment with someone to help me learn git,
> >> so who knows, we might have a proper source repository soon.
> > That'd be great.
>
> > Say, when you're doing this, can you take a look at the changes I've  
> > made and consider incorporating them? There's a "pristine" branch  
> > which has your code as you delivered it, and "master" which contains  
> > my derivative version. My code is athttp://github.com/igal/bertrand/tree/master

Wm Leler

unread,
Feb 18, 2009, 6:09:10 PM2/18/09
to bertrand-...@googlegroups.com
I'll make an announcement as soon as we figure it out. Hopefully
tomorrow.

--wm

Igal Koshevoy

unread,
Feb 18, 2009, 6:38:25 PM2/18/09
to bertrand-...@googlegroups.com
Nat wrote:
> Will http://github.com/igal/bertrand/tree/master be the official master branch?
No. The official master should either live in an account named after the
project -- like "bertrand" -- to make it easier for multiple people to
collaborate on development, or under Wm's account since he's the author.

My repo was intended to provide a working version of Bertrand for modern
compilers. The current version of the ZIP file provides most of this
functionality now.

> Should I start tracking this, or stick to downloading the ZIP files for the moment?

It'd be best to hold off until Wm decides what to do.

-igal

Reply all
Reply to author
Forward
0 new messages