From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,c95f09feb6654ea8,start X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,c95f09feb6654ea8,start X-Google-Attributes: gid103376,public X-Google-Thread: fdb77,c95f09feb6654ea8,start X-Google-Attributes: gidfdb77,public X-Google-Thread: 109fba,c95f09feb6654ea8,start X-Google-Attributes: gid109fba,public From: amir@iae.nsk.su Subject: Extention of names scoping (autodelegation) Date: 1998/07/08 Message-ID: <6nvdse$77i$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 369400227 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Jul 08 09:24:31 1998 GMT Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.eiffel,comp.lang.java.advocacy X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 95) Date: 1998-07-08T00:00:00+00:00 List-Id: I am doing low-level staff and C++ is the most suitable tool for me now. But I want something better. All newer languages are oriented for frameworks and ignore my needs. The C9X draft contain nothing important. I have various ideas about language I want but I never would have time nor have enough experience to build complete definition. So I post this in hope somebody will pick it up. Standard name scoping: type typeA { A1, A2: something } type typeB { B1: typeA } var B:typeB; usage: B.B1.A1:=B.B1.A2 or with B.B1 { A1:=A2 } Proposed extentions: 1) Synonyms.1 type typeB { B1:typeA; B2=B1.A1 } type typeB { B1:typeA; =B1.A1 } -- shortcut for A1=B1.A1 2) Open members: type typeB { B1::typeA } -- A1 & A2 delegated, B.A1:=B.A2 now legal type typeB { B1::typeA; A1:something } -- A2 delegated, A1 not type typeB { B1::typeA; B2::{ A1:something } } -- A2 delegated, A1 not (because of conflict) in last B.A1 is undefined but B.B1.A1 & B.B2.A1 still legal type typeB { { B1::typeA; } B2::{ A1:something } } -- unnamed block decrease the priority of delegates, so B.A1 mean B.B2.A1and B.A2 mean B.B1.A2 note: A {B} {{C}} dont work, should be A {B {C}} 3) Synonyms.2 type typeC { C1:typeB; C2==C1.B1 } -- C2 is open, C.A1 & C.A2 legal type typeC { C1:typeB; ==C1.B1 } -- shortcut for B1==C1.B1 or just opening of it without definition of B1? I am not sure. type typeC { C1::typeB; A1= } -- undefine A1 The necessary restriction is that every use of synonyms must be resolved to some actual names. Now we can construct type system 1) Types -- precisely describe the layout of data in memory. Records, variants, arrays. type typeA { Count:int; Items::[20] typeItem } -- index operation delegated A[-1] return some part of Count :) No virtuals. Access to const members (attributes), fields and parameterless functions are uniform. 2) Type extentions -- can define overlapped fields, const, synonyms and methods, cannot change layout. with typeA extA { Tag:tagType; -- overlapped with Count First=Item[0]; proc Last return typeItem { Result:=Items[Count] } } Everywhere extA visible, typeA.Tag and others are defined. Various extentions of typeA are combined as open members typeA: { extA1:: extA2:: extA3:: } Concrete extention can be used A.extA.Tag Anonimous extentions are allowed but every one is distinct. 3) Interfaces -- abstract sets of propeties and methods. No data fields. interface faceA { State:int; -- read-write property :int; -- write only proc Connect(Other : Same); } Interfaces can be combined by structured way or by set operations. Interface can be build upon type or variable, if it have proper set of defined fields and methods. Some interface members can be specified a la synonims others by names. 4) Interface pointers -- multy-method closures, dinamic dispatch. Its your question, did the interface contain IUnknown. Some minorities: postfix operator@ -- self assigment: x@+1; max(x@,0); head.next@.next; some.long.x@*@+2*@+1; ??? :) What do you think? Amir -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum