Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.maple > #230

Re: Problem with Seq. Delayed Evaluation?

Path csiph.com!x330-a1.tempe.blueboxinc.net!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Joe Riel <joer@san.rr.com>
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> (permalink)
References <Xns9F5FB13FEA264tomdeanspeakeasyorg@216.196.97.142>
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

Show key headers only | View raw


Thomas Dean <tomdean@speakeasy.org> 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

Back to comp.soft-sys.math.maple | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Problem with Seq.  Delayed Evaluation? Thomas Dean <tomdean@speakeasy.org> - 2011-09-13 19:25 -0500
  Re: Problem with Seq.  Delayed Evaluation? Joe Riel <joer@san.rr.com> - 2011-09-13 19:33 -0700
    Re: Problem with Seq.  Delayed Evaluation? Thomas Dean <tomdean@speakeasy.org> - 2011-09-14 00:26 -0500
      Re: Problem with Seq.  Delayed Evaluation? Joe Riel <joer@san.rr.com> - 2011-09-14 08:20 -0700

csiph-web