[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] New Education script::Counting half steps
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] New Education script::Counting half steps |
Date: |
Mon, 23 Feb 2015 17:06:07 +0000 |
On Mon, 2015-02-23 at 10:49 -0600, Jeremiah Benham wrote:
>
> On Fri, Feb 20, 2015 at 11:24 AM, Richard Shann
> <address@hidden> wrote:
> (this is just another instalment ... I can't write for long)
>
>
> You can replace this with the use of Denemo's (disp ...)
> procedure which
> can take any number of arguments so it would look like
>
> (disp "You have chosen " CountHalfSteps::userinput " half
> steps\nThe
> answer was " CountHalfSteps::interval "\n")
>
>
>
> I see that does make things easier. Thanks!
>
>
>
>
> Another simplification - I assume none of the variables are
> used outside
> of the script, so there is no need to create all those global
> variables
> starting CountHalfSteps::
> instead can avoid the long-winded names like
> CountHalfSteps::userinput
> by enclosing the entire script in a (let ....) like this
>
>
> (let ((userinput #f) (...) (...))
>
>
> Ok. I will change this. I assume though that you would want to use
> globals if I was creating an init script.
Yes, the more common case is a variable that you want to remember from
one invocation of your script to the next.
We have a macro (define-once ...) to use in that case, which ensures it
is initialized only once (guile 1.8 didn't need this - we just used the
undefined? procedure). You just use it at the top of the script.
I'm still unable to work on stuff mostly right now - as soon as I can
I'll push on with the release.
Richard
>
>
- [Denemo-devel] New Education script::Counting half steps, Jeremiah Benham, 2015/02/18
- Re: [Denemo-devel] New Education script::Counting half steps, Richard Shann, 2015/02/19
- Re: [Denemo-devel] New Education script::Counting half steps, Richard Shann, 2015/02/20
- Re: [Denemo-devel] New Education script::Counting half steps, Richard Shann, 2015/02/21
- Re: [Denemo-devel] New Education script::Counting half steps, Richard Shann, 2015/02/21
- Re: [Denemo-devel] New Education script::Counting half steps, Richard Shann, 2015/02/21