This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Another CTAX syntax RFC


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]