[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "procedure" vs. "function"
From: |
Wols Lists |
Subject: |
Re: "procedure" vs. "function" |
Date: |
Sat, 18 Apr 2015 17:01:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 18/04/15 16:21, Urs Liska wrote:
> So the choice of these names is actually an inconsistency in LilyPond's
> terminology?
>
> I'm asking this because I have just completed a tutorial about
> define-music-function and its siblings, and I realized that I used the
> terms function and procedure in an arbitrary mix.
>
> Now I think that I should follow the consistency of the Guile manual ,
> use "procedure" everywhere in my text and point out the inconsistency in
> naming.
I notice you're talking about functions and procedures, where other
people have been talking about functions and subroutines.
As I understand it, they're all procedures - a procedure is an external
section of code. A procedure may be a subroutine, that does not return a
value but CAN have side effects (ie modify non-local memory). A
function, on the other hand, does everything locally, has no side
effects, and returns its result. What you call a procedure that has side
effects AND returns a value is undefined ... :-)
Cheers,
Wol
Re: "procedure" vs. "function", Michael Hendry, 2015/04/18
Re: "procedure" vs. "function", David Nalesnik, 2015/04/18