Path: news.cs.au.dk!not-for-mail From: Ole Lehrmann Madsen Newsgroups: comp.lang.beta Subject: Re: Sif crashes on this Date: 14 Dec 1998 22:36:25 -0000 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 195 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <19981214223625.1880.qmail@noatun.mjolner.dk> Reply-To: Ole Lehrmann Madsen NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 913675005 968 255.255.255.255 (14 Dec 1998 22:36:45 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 14 Dec 1998 22:36:45 GMT Xref: news.cs.au.dk comp.lang.beta:11752 You have encountered an error in the BETA compiler. Patterns like fun: (# exit 666 #) are optimized as constants by the compiler. When used as pattern variables as in your program, the compiler gets confused. You may get around the problem by making fun a non-constant pattern as in fun: (# dummy: @integer exit 666 #) f2: (# dummy: @integer exit 2 #) Note that f1 is a pattern with (666,2) as an exit value This is not very nice, but should work. We will eventually correct the error. Don't hesitate to ask further questions or contacting us. Sincerely Ole Lehrmann Madsen PS. I did not try the example with Sif, but the error should be Sif specific. > I'm trying to figure out the BETA equivalent of calling a function through a pointer. I > don't have the BETA book yet, and the tutorials don't seem to address the question. > While playing around I discovered that attempting to compile: > > ORIGIN '~beta/basiclib/v1.6/betaenv'; > -- program: Descriptor -- > (# > fun: (# exit 666 #); > fptr: ##fun; > f1: fun (# exit 1 #); > f2: (# exit 2 #) > do f1##->fptr## > #) > > ..as the body of a new program crashes Sif with the following message: > > > > Sif - Mjolner Browser and Editor version 5.2(0) nti > integrated with BETA Compiler version 5.3(4) > Calling BETA compiler > ------------------------------------------------------------------------------- > No qua-check warnings and .lst file > Target machine type nti(ms) > Building dependency graph for: 'k:\beta\start\fptr\fptr' ... > Translating fragments ... > Bind fragments in: 'k:\beta\start\fptr\fptr'Code generation > DescRef is null! Fatal error > f1 > > > > I compiled from the command line, and the compiler crashed as well. Here's the resulting > beta.dump file: > > > > Beta execution aborted: Reference is none. > > Call chain: (nti) > > item putText# in ~beta/betaast/v5.2/private/indeximpl > -- outputStream#output# in ~beta/betaast/v5.2/private/indeximpl > item <*> in ~beta/pretty/v5.2/private/token > -- Output# in ~beta/pretty/v5.2/private/token > item in ~beta/pretty/v5.2/private/token > -- Token# in ~beta/pretty/v5.2/private/token > item in ~beta/pretty/v5.2/private/printer > -- Viewer# in ~beta/pretty/v5.2/astviewer > item in ~beta/pretty/v5.2/private/scanner > -- SCANNER-~ in ~beta/pretty/v5.2/private/scanner > item in ~beta/pretty/v5.2/private/scanner > -- SCANNER-~ in ~beta/pretty/v5.2/private/scanner > item in ~beta/pretty/v5.2/private/unparser > -- Viewer# in ~beta/pretty/v5.2/astviewer > item in ~beta/pretty/v5.2/private/ppimpl > -- present# in ~beta/pretty/v5.2/astviewer > item in ~beta/pretty/v5.2/astviewer > -- Viewer# in ~beta/pretty/v5.2/astviewer > item in ~beta/betaast/v5.2/private/indeximpl > -- prettyPrinter# in ~beta/betaast/v5.2/index > item in ~beta/betaast/v5.2/index > -- *astInterface# in ~beta/compiler/control/systembody > item in ~beta/compiler/control/systembody > -- compiler# in ~beta/compiler/control/system > item in ~beta/compiler/checker/semattbody > -- SEMATT-~ in ~beta/compiler/checker/sematt > item strucRef# in ~beta/compiler/checker/sematt > -- *EvCase# in ~beta/compiler/synthesizer/evbody > item in ~beta/compiler/checker/semattbody > -- *EvCase# in ~beta/compiler/synthesizer/evbody > item * in ~beta/compiler/checker/sematt > -- SEMATT-~ in ~beta/compiler/checker/sematt > item in ~beta/compiler/synthesizer/evbody > -- ExpEval# in ~beta/compiler/synthesizer/synthlib > item in ~beta/compiler/synthesizer/synthlib > -- EvalHandler# in ~beta/compiler/synthesizer/synthlib > item binEv# in ~beta/compiler/synthesizer/evbody > -- *EvCase# in ~beta/compiler/synthesizer/evbody > item in ~beta/compiler/checker/semattbody > -- *EvCase# in ~beta/compiler/synthesizer/evbody > item * in ~beta/compiler/checker/sematt > -- SEMATT-~ in ~beta/compiler/checker/sematt > item in ~beta/compiler/synthesizer/evbody > -- GenEval# in ~beta/compiler/synthesizer/synthlib > item in ~beta/compiler/synthesizer/synthlib > -- EvalHandler# in ~beta/compiler/synthesizer/synthlib > item <*> in ~beta/compiler/synthesizer/dobody > -- *scanList# in ~beta/compiler/synthesizer/dobody > item <*>scanList# in ~beta/compiler/synthesizer/dobody > -- Scan# in ~beta/compiler/synthesizer/dobody > item in ~beta/compiler/synthesizer/dobody > -- * in ~beta/compiler/synthesizer/dobody > item <*> in ~beta/compiler/synthesizer/dobody > -- GenDo# in ~beta/compiler/synthesizer/genlib > item in ~beta/compiler/synthesizer/dobody > -- theGen# in ~beta/compiler/synthesizer/synthesizer > item in ~beta/compiler/synthesizer/genlib > -- theGen# in ~beta/compiler/synthesizer/synthesizer > item in ~beta/compiler/synthesizer/gdbody > -- GenDesc# in ~beta/compiler/synthesizer/synthesizer > item in ~beta/compiler/synthesizer/synthesizer > -- theGen# in ~beta/compiler/synthesizer/synthesizer > item in ~beta/compiler/synthesizer/synthesizer > -- SYNTHESIZER-~ in ~beta/compiler/synthesizer/synthesizer > item in ~beta/compiler/synthesizer/synthesizer > -- Synthesizer# in ~beta/compiler/control/system > item in ~beta/compiler/control/system > -- compiler# in ~beta/compiler/control/system > item in ~beta/compiler/control/translate_controlbody > -- xcontroller#ScanNonCompiled#scanner# in ~beta/compiler/control/translate > item <*> in ~beta/compiler/control/translate_controlbody > -- Translate#translate# in ~beta/compiler/control/translate > item translate# in ~beta/compiler/control/translate_controlbody > -- xcontroller#ScanNonCompiled#scanner# in ~beta/compiler/control/translate > item Translate# in ~beta/dependency/v1.3/private/scannoncompiledbody > -- *controller# in ~beta/dependency/v1.3/private/scannoncompiledbody > item <*>ScanAndClear# in ~beta/dependency/v1.3/private/controlbody > -- TransList#SimpleList# in ~beta/dependency/v1.3/private/dependencybody > item in ~beta/dependency/v1.3/private/controlbody > -- *controller# in ~beta/dependency/v1.3/private/scannoncompiledbody > item * in ~beta/dependency/v1.3/private/dependencybody > -- xcontroller#ScanNonCompiled#scanner# in ~beta/compiler/control/translate > item xcontroller#scanner# in > ~beta/dependency/v1.3/private/scannoncompiledbody > -- depGraph#DependencyGraph# in ~beta/compiler/control/translate > item in ~beta/compiler/control/translatebody > -- TRANSLATE-~ in ~beta/compiler/control/translate > item in ~beta/compiler/control/translate > -- compiler# in ~beta/compiler/control/system > item in ~beta/compiler/control/systembody > -- *translate# in ~beta/compiler/control/interactive > item * in ~beta/compiler/control/system > -- compiler# in ~beta/compiler/control/system > item in ~beta/compiler/control/interactive > -- interactiveCompiler# in ~beta/compiler/control/interactive > item in ~beta/compiler/control/interactive > -- PROGRAM-~SystemEnv#SysHead# in ~beta/compiler/beta > comp SystemEnv#SysHead# in ~beta/compiler/beta > -- BETAENV-~ in ~beta/basiclib/v1.6/betaenv > > > item realValue# in ~beta/basiclib/v1.6/private/basicsystemenvbody > -- BASICSYSTEMENVPRIVATE-~ in ~beta/basiclib/v1.6/private/basicsystemenvbody > item <*>cycle# in ~beta/basiclib/v1.6/private/systemenv_ntbody > -- BASICSCHEDULER-~ in ~beta/basiclib/v1.6/private/systemenv_ntbody > comp in ~beta/basiclib/v1.6/private/systemenv_ntbody > -- PROGRAM-~SystemEnv#SysHead# in ~beta/compiler/beta > > > basic component in ~beta/basiclib/v1.6/betaenv > > > Legend: > <> > > > > BTW, what's the solution to my original problem? > > Jean-Louis Leroy > http://ourworld.compuserve.com/homepages/jl_leroy/ > >