Steve:

Thanks for the hint (I did poor example on my problem).  My main issue was
on whether display-fluxes can work with a list input.  Your answer
indirectly confirmed that it is the case.  And by using
(apply display-fluxes pm),

the problem is solved.

Much thanks!!

Puck

On Mon, Sep 22, 2008 at 5:16 PM, Steven G. Johnson <[EMAIL PROTECTED]>wrote:

> On Sep 19, 2008, at 6:41 PM, Puck Ja wrote:
> > I plan to make several flux objects to monitor the flux along a
> > lossy waveguide in the longitudinal direction.  Trying not to hard
> > code each objects by doing
> > (define p1 (add-flux .... (center 1 0 )...
> > (define p2 (add-flux .... (center 2 0 )...
> > ...etc,
> >
> > I would appreciate any help on better way to do it.  I have tried to
> > make list of flux objects such as
> > (define pn
> >    (map (lambda (pos)
> >        (append (add-flux ....) (add-flux ...) ...) (list 1 2 3 4)))
>
>
> add-flux does not return a list, so you can't call "append" on it.
> You don't need to call "append" inside "map", because "map" already
> returns a list.
>
> You can do something like:
>
> (define pm (map (lambda (pos) (add-flux ... (center pos) ...))
>                                 (list 1 2 3 4))
>
> There are many references on the Scheme language online that you can
> read to help you understand constructs like "map".
>
> Steven
>
> _______________________________________________
> meep-discuss mailing list
> [email protected]
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>



-- 
Shiou-jyh (Puck) Ja, PhD
Tel: 1.405.762.1471
[EMAIL PROTECTED]
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to