Language design question

flisakow@ricotta.cs.wisc.edu (Shaun Flisakowski)
13 Feb 2000 20:15:23 -0500

          From comp.compilers

Related articles
Language design question flisakow@ricotta.cs.wisc.edu (2000-02-13)
Re: Language design question world!cfc@uunet.uu.net (Chris F Clark) (2000-02-13)
Automatic dereference operator: (Was: Language design question) idbaxter@semdesigns.com (Ira D. Baxter) (2000-02-13)
Re: Language design question jejones@microware.com (James Jones) (2000-02-15)
Re: Language design question flisakow@ricotta.cs.wisc.edu (2000-02-15)
Re: Language design question mkg@lanl.gov (2000-02-16)
Re: Language design question joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-02-16)
[7 later articles]
| List of all articles for this month |

From: flisakow@ricotta.cs.wisc.edu (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?


Thanks,
Shaun
--
    Shaun Flisakowski flisakow AT spf-15.com
    http://www.spf-15.com - 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.