Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joe Riel Newsgroups: comp.soft-sys.math.maple Subject: Re: Supressing Set statements Date: Fri, 16 Sep 2011 15:41:25 -0700 Organization: A noiseless patient Spider Lines: 67 Message-ID: <87ty8c2jqi.fsf@san.rr.com> References: <1316204866.109484@athprx04> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="7daQ3AF9ALJlnU9jGWSG5Q"; logging-data="30509"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18f6yjUwihKR51X6dK/6nxK" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:ZVlSYUKZ+tHciBXXDaiHKa6kFso= sha1:cSI+iYOa6radWQaTHPNnv4ZJGFw= Xref: x330-a1.tempe.blueboxinc.net comp.soft-sys.math.maple:238 "I.N. Galidakis" writes: > Hi everyone, > > Does anyone know how to suppress set statements on the output? > > I have the following declarations in Maple 9: > > E:={}:#board encodings > > and later on, in a procedure, I augment E by the current board encoding: > >> move:=proc(p,q,n,c1,r1,c2,r2) >> global E; >> if p[c1,r1]<>[] then >> if n<>0 then rotate(p,c1,r1,n);fi; >> if fits(p,q,c1,r1,c2,r2) then >> q[c2,r2]:=p[c1,r1];#set to puzzle >> p[c1,r1]:=[];#remove from board >> print("moving:",n,c1,r1,"->",c2,r2); >> stack[push]([n,c1,r1,c2,r2], S);#push into stack of moves >> E:=E union {enc(q)}:#add new state to set of states >> else >> print("Illegal move!"); >> fi; >> else >> print("Source is empty!"); >> fi; >> end: > > In my loop, I call: > >> while pef(q)<202 do >> gen(p,q);#creates G >> while G=[] do >> undo(p,q): >> gen(p,q): >> od; >> bm:=pick(p,q): >> while bm=0 do >> undo(p,q): >> gen(p,q): >> bm:=pick(p,q): >> od; >> #print("Picking move in G:",bm,nops(NE)); >> #print("Generated:",G);print("New States:",NE); >> move(p,q,G[bm][1],G[bm][2],G[bm][3],G[bm][4],G[bm][5]): >> od; > > When I run the above loop, I get a repeated and growing set E on the output, > DESPITE having supressed all statements relating to E, which I don't want to see > (unless I am debugging) because it contains very big numbers, is very big in > size and slows Maple down a lot, because this is a puzzle search, so it can take > zillions of tries. > > How can I suppress the output of the set E? > > Maybe if I declare it as something else? A list? A colon as line terminator to suppress output only has an effect at the outermost level. Here you would suppress all output in the loop by terminating the final 'od' with a colon. The colons on the statements inside the loop might as well be semicolons. -- Joe Riel