Path: news.daimi.aau.dk!news.uni-c.dk!newsfeed.sunet.se!news01.sunet.se!sunic!mn6.swip.net!plug.news.pipex.net!pipex!weld.news.pipex.net!pipex!hole.news.pipex.net!pipex!tube.news.pipex.net!pipex!lade.news.pipex.net!pipex!news.be.innet.net!INbe.net!news.nl.innet.net!INnl.net!hunter.premier.net!news.mathworks.com!fu-berlin.de!zrz.TU-Berlin.DE!news From: Kai Petzke Newsgroups: comp.lang.beta Subject: Re: Global Variables Date: Thu, 09 May 1996 17:54:52 +0200 Organization: Technical University Berlin, Germany Lines: 45 Message-ID: <3192154C.41C6@idefix.physik.tu-berlin.de> References: <318F2E76.41C6@idefix.physik.tu-berlin.de> NNTP-Posting-Host: foxylady.physik.tu-berlin.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.0 (X11; I; IRIX 5.2 IP20) To: Claus-Peter Knaut Claus-Peter Knaut wrote: > We want to use the persistent store to save tuples of a > relation on a disk. But to use a global variable in tuple, tuple.bet > has to have its ORIGIN in a global database slot. To save the tuple, > the pattern has to be declared in betaenv.bet, best in lib:attributes > SLOT. Well, I have used the persistentstore quite a lot, and I put objects in it, which have been defined below an lib:attributes slot. The only type of objects, that the persistentstore does not like (according to my experience) are the ones, that are directly or indirectly part of an component. In particular, the PROGRAM module of each BETA application is such a component. So the following piece of BETA won't work: ORIGIN 'betaenv'; INCLUDE 'persistentstore'; INCLUDE 'database'; --- program: descriptor --- (# mydb: @database; ps: @persistentstore; do (* initialisation left out *) (mydb.newTuple, 'tuple1')->ps.put; #); However, the following should work: ORIGIN 'betaenv'; INCLUDE 'persistentstore'; INCLUDE 'database'; --- program: descriptor --- (# mydb: ^database; ps: @persistentstore; do &datbase[] -> mydb[]; (* further initialisation *) (mydb.newTuple, 'tuple1')->ps.put; #); Kai