Path: news.daimi.aau.dk!news.uni-c.dk!sunic!sunic.sunet.se!newsfeed.tip.net!news.seinf.abb.se!usenet From: Daniel Larsson Newsgroups: comp.lang.beta Subject: Re: Constants in Beta Date: 20 Apr 1995 20:00:34 GMT Organization: ABB Infosystems AB Lines: 32 Message-ID: <3n6eh2$7ic@sdaw04.seinf.abb.se> References: <3n1mdi$6h3@pulm1.accessone.com> NNTP-Posting-Host: ws210.sw.seisy.abb.se Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1b3 (X11; I; HP-UX A.09.03 9000/712) X-URL: news:3n1mdi$6h3@pulm1.accessone.com Baiss E. Magnusson wrote: > ... > >Now in a real world application these numbers would exist in a separate > file and they would be reference by some constant name, or they >would be calculated based upon some environmental setting. > >This is accomplished in C with <#defines> so the above would be: >#define H_WINDOW 100 >... > do (H_WINDOW, V_WINDOW) -> position; > (WINDOW_WIDTH, WINDOW_HEIGHT) -> size; >etc. > >What method in Beta would you use to replace all hard coded numeric >values with substitute values? What is wrong with this? H_WINDOW : (# exit 100 (* or whatever *) #) V_WINDOW : (# exit 100 (* or whatever *) #) .. Patterns only exiting a constant is the Beta construct most closely corresponding to C #defines (only they are expressed within the language instead of a separate language) -- ------------------------------------------------------------------ Daniel Larsson email: dlarsson@sw.seisy.abb.se ABB Industrial Systems AB phone: +46-21-34 30 29 S-721 67 Vaesteraas, Sweden fax : +46-21-34 25 55