This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Another CTAX syntax RFC
- To: guile at sourceware dot cygnus dot com
- Subject: Another CTAX syntax RFC
- From: Ian Bicking <ianb at colorstudy dot com>
- Date: Mon, 31 Jul 2000 13:03:11 -0500
I just started implementing structs (guile records). And now I reach
a point where previous decisions conflict with C.
So, in C, you'd do:
struct point {
int x;
int y;
}
And then:
struct point foo;
While it would fit better with Scheme semantics (and what I've already
done) to do:
var foo=new point; (or `var foo=new struct point;' ?)
But this starts going into C++-like syntax... next thing you know
I'll be stuck with the entire OO structure. Which wouldn't be so bad,
but I want to start out with a more simple C-like system.
And on the subject of records, are there procedures for setting and
getting fields by symbol. E.g.,
(define <point> "point" '(x y))
(define new-<point> (record-constructor <point> '()))
(define foo (new-<point>))
(set-record-field! foo 'x 10)
(get-record-field foo 'x)
-- Ian