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]

Re: Another CTAX syntax RFC


On Mon, 31 Jul 2000 13:03:11 -0500, ianb@colorstudy.com wrote:
> 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.

Talking about OO stuff - how about an Objective-C style syntax - a much
simpler and more flexible OO language than C++ ...

id foo = [point new];

(where 'id' can refer to an object of any class), or

point* foo = [point new];

The second form is user where type checking is desired.



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