Language design question (Shaun Flisakowski)
13 Feb 2000 20:15:23 -0500

          From comp.compilers

Related articles
Language design question (2000-02-13)
Re: Language design question world! (Chris F Clark) (2000-02-13)
Automatic dereference operator: (Was: Language design question) (Ira D. Baxter) (2000-02-13)
Re: Language design question (James Jones) (2000-02-15)
Re: Language design question (2000-02-15)
Re: Language design question (2000-02-16)
Re: Language design question (Joachim Durchholz) (2000-02-16)
[7 later articles]
| List of all articles for this month |

From: (Shaun Flisakowski)
Newsgroups: comp.compilers
Date: 13 Feb 2000 20:15:23 -0500
Organization: U of Wisconsin CS Dept
Keywords: design, question, comment

I'm working on a language design that is a hybrid of C and pascal.

It seems that with strong typing, there is no need for a dereferencing
operator, as the compiler could add these automatically. (I'd still
have an address-of operator)

For example:

        type TRec = struct
                a: short;

        var p: pointer to pointer to pointer to TRec;
        var r: pointer to TRec;

        p = r; // Ok, equiv to: **p = r
        r = p; // Ok, equiv to r = **p

        p = nil; // Error, ambigious
        p = nil as pointer to pointer to TRec; // Ok

        r = nil; // Ok, unambigious

        p.a = 5;
        r.a = 7;

Does anyone see any problem with this that I'm overlooking?
Are there any existing langues that handle this similarly?

    Shaun Flisakowski flisakow AT - Windows Games, and Unix Freeware.
[This sounds a lot like Algol 68 coercion. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.