lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding a markup ("sim.") to the end of a SustainPedalBracket


From: David Kastrup
Subject: Re: adding a markup ("sim.") to the end of a SustainPedalBracket
Date: Mon, 28 Dec 2015 23:13:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Thomas Morley <address@hidden> writes:

> Though I'm not sure with the following one. May I ask: curried or not?
> (define (foo a b)
>   (let ((x2 (lambda (arg) (* 2 arg))))
>     (map x2 (list a b))))

Why would that one be curried?  It's completely boring, returns a list,
and its internal function x2 is totally straightforward (not even a
closure) and is invisible to the caller.

Slightly more interesting is

(define (fie a)
  (lambda (x) (+ x a)))

which is equivalent to the curried definition

(define ((fie a) x) (+ x a))

However, the currying is not a feature of the semantics (the semantics
of returning a function or more often a closure, namely a function with
an environment in the form of variables imported into its scope) but of
the syntax.

So while the second definition of fie is a curried definition, the first
equivalent definition isn't.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]