Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!src.dec.com!buschman@tubsibr.uucp From: buschman@tubsibr.uucp (Andreas Buschmann) Newsgroups: comp.lang.modula3 Subject: LOCATION Message-ID: <9104151354.AA01507@pollux> Date: 15 Apr 91 13:54:25 GMT Reply-To: buschman@tubsibr.uucp Lines: 68 To: kalsow (Bill Kalsow) Cc: m3 Hi! > > For my interpreter I created a procedureal operator LOCATION: > > > > LOCATION (VAR x: Any) : REF Any > > > > How is this supposed to go in the new standard? > > I don't understand. Are you proposing that LOCATION be added to the > language? If so, you should post a full explanation of the proposal > and its impact. For instance, it appears to me that LOCATION would > place great constraints on the possible allocator/collector implementations. > Since I can use LOCATION to create a REF to an arbirary field in an > arbitrary record, the collector cannot assume that type tags are near by? > > - Bill Kalsow no, I am not sure about proposing this to be added to the language. At this moment it is a local hack of mine, which doesn't interfere with my heap storage implementation (I am using bitmaps to keep track of which storage is still in use). What I want to know is: how do I get the same effect, with legal actions defined in Modula3. Tschuess Andreas A C example of what I want to do: typedef struct node { struct node *next; int info; } NODE; #define NO_NODE ((NODE*) 0) insert (NODE **list; NODE *new_node) { NODE **ptr; for (ptr = list; *ptr != NO_NODE && (*ptr) -> info < new_node -> info; ptr = &((*ptr) -> next)); new_node -> next = *ptr; *ptr = new_node; } in Algol68 this would be: MODE NODE = STRUCT ( REF NODE next; INT info ); REF NODE no node = NIL; PROC insert (REF REF NODE list; REF NODE new node) = BEGIN REF REF NODE ptr; ptr := list; WHILE (ptr <> no node | info OF ptr < info OF new node | false) DO ptr := next OF ptr OD; next OF new node := ptr; REF NODE ptr := new node END