That's simply notation for defining a procedure or a function.

Here's an example:

meep> (define square (lambda (x) (* x x)))
meep> (square 4)
16

In that example, square is a procedure that takes one argument, x, and returns (* x x).

You can read more about lambda expressions here:
http://www.gnu.org/software/guile/manual/guile.html#Lambda

Best,
Matt





On Wed, 28 Oct 2009, liu wrote:

Hi, I have seen the following ctl file,
---------------------------

(define mysource (lambda (t) (sin (* 10 t))))

(define cs (list (make source
     (src (make custom-src
     (src-func mysource) (start-time start) (end-time end)))
     (component Ez) (center 0 0) (size 0 0))))

---------------------------

My question is what does "lambda(t) " mean? does it mean that the source is with a single frequency with amplitude changing sin(10t)?

_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to