Path: news.daimi.aau.dk!news.uni-c.dk!sunic!sunic.sunet.se!news.kth.se!nac.no!ifi.uio.no!nntp!alfh From: alfh@byleist.ifi.uio.no (Alf-Ivar Holm) Newsgroups: comp.lang.beta Subject: Re: Sub Class generates linker error Date: 21 Apr 1995 13:29:06 GMT Organization: Dept. of Informatics, University of Oslo, Norway Lines: 58 Message-ID: References: <3n6lb7$g96@pulm1.accessone.com> NNTP-Posting-Host: byleist.ifi.uio.no In-reply-to: Baiss E. Magnusson's message of 20 Apr 1995 21:56:55 GMT CC: In article <3n6lb7$g96@pulm1.accessone.com> Baiss E. Magnusson writes: > I am doing something wrong with creating a sub-pattern of the sub-pattern > of the file . I get a linker error, not a > compiler error, as shown below. The linker error/warning is caused by your 'myEventHandler', it has no 'do' part with an INNER (neither has 'eventHandler' in the libraries). The do part of 'DoEditMenu' will not be done. > I would like to call the sub-pattern from wherever, and in > the example below from within the pattern , which is inside > the superpattern. > What syntax would correctly do what I need to do? You have already figured out this one. > myEventHandler : eventHandler > (# > menuSelected ::< > (# > do > (if menu > //editId then item -> DoEditMenu; > if); > #); > #) > > DoEditMenu: myEventHandler > (# item: @integer; > enter item > do > ... > #) > ***** The superpattern of this descriptor has no INNER I am not sure what you want to do, but you seem to go a bit over the top about sub-patterns :-) The 'eventHandler'-patterns in the libraries are virtual patterns that are instantiated by 'theEventHandler', which is called from other patterns in the libraries. The 'eventHandler' has no 'do' part, it is just a pattern that 'Encapsulates the patterns related to eventhandling'. (Copied from guienv.bet :-) When you make a sub-pattern of 'eventHandler', that sub-pattern have to be called by your own (sub-)patterns to get instantiated. If you want your own 'eventHandler' to be called by the library patterns, it is easiest to make a further binding of the 'eventHandler', ala: eventHandler :: (# menuSelected ::< (# ... #); ... #) Hope this helps. Affi