This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: Another CTAX syntax RFC
- To: ianb at colorstudy dot com
- Subject: Re: Another CTAX syntax RFC
- From: richard at brainstorm dot co dot uk
- Date: Mon, 31 Jul 2000 19:01:57 +0100
- Cc: guile at sourceware dot cygnus dot com
- References: <20000731130311.A349@localhost>
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.