Path: news.daimi.aau.dk!jlk From: jlk@daimi.aau.dk (Jorgen Lindskov Knudsen) Newsgroups: comp.lang.beta Subject: Re: Beta parameter passing trouble Date: 4 Jul 1997 06:38:32 GMT Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 79 Message-ID: <5pi5p8$3hd$1@gjallar.daimi.aau.dk> References: <5ph9nr$m7p$1@nyheter.chalmers.se> Reply-To: jlknudsen@daimi.aau.dk (Jorgen Lindskov Knudsen) NNTP-Posting-Host: arsenic.daimi.aau.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: NN version 6.5.1 (NOV) Xref: news.daimi.aau.dk comp.lang.beta:11176 In <5ph9nr$m7p$1@nyheter.chalmers.se> "Robert Huber" writes: >Hi! >I have a lot of problem with a thing that should not be that difficult. >Consider this source. I want to know why this doesnt work. >¦checkSuperClass: >¦ (# fatherAst: ^ast; aClasses: ^classes; aClass: ^class; ok: @boolean; >¦ c:^text; s:^text; co:@text; so:@text; nd:^nameDecl; >¦ do >¦ 'apa'->screen.putText; >¦ 'apa'->co; >¦ co[]->screen.putLine; >¦ >¦ father->fatherAst[]; >¦ THIS(class)[]->aClass[]; >¦ (if fatherAst[] <> none then >...... >The part... >'apa'->co; >co[]->screen.putText; >...generates two errors, that is both "Incompatible left- and right-side of >assignment". >The source is part of a semantic level fragmentgroup and checkSuperClass is >a >fragmentform in this fragmentgroup. Just to be sure, we are discussing the same problem, I have tried to 'package' your example as a complete source-file: ORIGIN '~beta/mps/v5.1/astlevel'; --- astinterfacelib: attributes --- classes: (# #); class: ast (# checkSuperClass: (# fatherAst: ^ast; aClasses: ^classes; aClass: ^class; ok: @boolean; c:^text; s:^text; co:@text; so:@text; nd:^nameDecl; do 'apa'->screen.putText; 'apa'->co; co[]->screen.putLine; father->fatherAst[]; THIS(class)[]->aClass[]; (if fatherAst[] <> none then (* ... *) if) #); #) This compiles fine on my system, so could you supply more details. Your problem does not seem to be originating from this code. When reading your original code sequence, nothing seems to be wrong. Just a thought: are you sure, that you have not, by accident, defined a new 'text' pattern somewhere (visible to this code segment). That would definitely explain the behaviour, you are observing in your program segment. Please let us all know what you find. And drop a note here again, if this does not help. Regards, Jorgen Lindskov Knudsen -- * Jorgen Lindskov Knudsen | Phone: +45 8942 3188 * * Dept. of Computer Science | Direct: +45 8942 3233 * * University of Aarhus | Fax: +45 8942 3255 * * Ny Munkegade, Building 540 | GSM: +45 2099 7357 *