Path: csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joe Riel Newsgroups: comp.soft-sys.math.maple Subject: Re: Problem with Seq. Delayed Evaluation? Date: Tue, 13 Sep 2011 19:33:23 -0700 Organization: A noiseless patient Spider Lines: 24 Message-ID: <878vpr3lak.fsf@san.rr.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="7daQ3AF9ALJlnU9jGWSG5Q"; logging-data="24279"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/a7ztz96Gna9oYzWJnZRtT" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:aWbYwmmTNfzbLPdAHwjfxRvuj0k= sha1:gVY8oazJdwLcLGvSc0g4ufpeAhQ= Xref: x330-a1.tempe.blueboxinc.net comp.soft-sys.math.maple:230 Thomas Dean writes: > I want to evaluate a Maple function in seq. > > seq(add(t,t=factorset(n)),n=1..1000) > > If I enter it as typed, I get 1..1000 since add is evaluated one time, I > think. Correct? No. I assume you first did with(numtheory). I then get seq(add(t,t=factorset(n)),n=1..1000); 0, 2, 3, 2, 5, 5, 7, ..., 501, 40, 7 > How do I delay evaluation of add and factorset until in seq? You shouldn't have to delay them; add and seq have special evaluation rules, the first argument is not evaluated until after the value of the index is substituted. -- Joe Riel