Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site aecom.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!cmcl2!philabs!aecom!eliovson From: eliovson@aecom.UUCP (Moshe Eliovson) Newsgroups: net.lang.c Subject: Re: Re: goto/forth Message-ID: <1209@aecom.UUCP> Date: Tue, 5-Mar-85 17:12:41 EST Article-I.D.: aecom.1209 Posted: Tue Mar 5 17:12:41 1985 Date-Received: Fri, 8-Mar-85 02:55:53 EST References: <8349@brl-tgr.ARPA> <281@talcott.UUCP> Organization: Albert Einstein Coll. of Med., NY Lines: 32 > > Technically it is illegal to assign `a=b', altho some compilers allow > > it. I read the release notes of a C compiler (pwb?) by dmr wondering > > why a label could be passed to as an argument. It seemed to be > > interpreted as a funxion ptr. Try using setjmp/longjmp to do this. > > setjmp/longjmp are slow, and they have the (in this case undesirable) > side effect of re-storing automatic variables. When I was faced with > the problem in a LISP interpreter, I came up with: > > #define transfer(f) return(fun)f > > fun next(); > > fun start() > { > transfer(next); > } > > eval() > { > register fun kont=start; > > while(kont) kont=(fun)(*kont)(); > } > > Thomas. How does this simulate 'a=b'? Could you please explain what this code is meant to do and how it achieves it? Moshe Eliovson philabs!aecom!eliovson