Newsgroups: comp.lang.beta Path: news.daimi.aau.dk!news.uni-c.dk!sunic!uunet!MathWorks.Com!europa.eng.gtefsd.com!news.umbc.edu!haven.umd.edu!ames!kronos.arc.nasa.gov!usenet From: bobo@avogadro.arc.nasa.gov (Mark Friedman) Subject: Re: what is a pattern? In-Reply-To: olevi@daimi.aau.dk's message of 8 Sep 1994 15:41:16 GMT Message-ID: Lines: 39 Sender: usenet@ptolemy-ethernet.arc.nasa.gov (usenet@ptolemy.arc.nasa.gov) Nntp-Posting-Host: avogadro.arc.nasa.gov Reply-To: bobo@ptolemy.arc.nasa.gov Organization: NASA/Ames Information Sciences References: <34n5ad$36s@gort.oit.umass.edu> <34nbas$a8d@belfort.daimi.aau.dk> Date: Thu, 8 Sep 1994 18:35:48 GMT In article <34nbas$a8d@belfort.daimi.aau.dk> olevi@daimi.aau.dk (Ole Villumsen) writes: multiply: (# a,b: @integer; enter (a,b) exit a*b #); In Beta a call to multiply might look like: (9,13) -> &multiply -> &putInt; (putInt is a procedure that writes the result on the screen.) stack: (# content: [100] @integer; currentSize: @integer; push: (# e: @integer; enter e do currentSize+1 -> currentSize; e -> content[currentSize]; #); empty: (# exit (currentSize=0) #); pop: (# e: @integer; do content[currentSize] -> e; currentSize-1 -> currentSize; exit e #); #); So far this makes patterns look pretty much like closures. How do they differ? -Mark -- Mark Friedman NASA-Ames Research Center MS 269-2 Moffett Field, CA 94035-1000 vmail: (415) 604-0573 email: bobo@ptolemy.arc.nasa.gov