[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Defining new Scheme predicates
From: |
Thomas Morley |
Subject: |
Re: Defining new Scheme predicates |
Date: |
Mon, 7 Nov 2016 01:58:33 +0100 |
2016-11-07 1:20 GMT+01:00 Andrew Bernard <address@hidden>:
> Hi Simon,
>
> Thanks! Exactly perfect. Sometimes the completely obvious escapes me. Better
> have another coffee.
>
> Most appreciated.
>
> I suppose of course that to make it a predicate without the preliminary let
> block (not that I have any objection to that) one would have to modify
> lilypond internals, which would not be desirable.
>
> Andrew
Hi Andrew,
do you want to have the _symbols_ 'left, 'right checked with "side?"?
Then Simons proposal could be changed to use "eq?"
Or do you want to check for the predefined left, right, center, LEFT,
RIGHT and CENTER? (Similiar for up, down)
Note:
(display left)
-> -1
Then something like
#(define side? (lambda (x) (->bool (member x (iota 3 -1 1)))))
may work:
(display (side? left))
->
#t
Use it as a toplevel-definition. No need to change any internals.
(Same for Simons suggestion)
Cheers,
Harm
- Defining new Scheme predicates, Andrew Bernard, 2016/11/06
- Re: Defining new Scheme predicates, Simon Albrecht, 2016/11/06
- Re: Defining new Scheme predicates, Simon Albrecht, 2016/11/06
- RE: Defining new Scheme predicates, Andrew Bernard, 2016/11/06
- Re: Defining new Scheme predicates,
Thomas Morley <=
- RE: Defining new Scheme predicates, Urs Liska, 2016/11/07
- Re: Defining new Scheme predicates, Richard Shann, 2016/11/07
- Re: Defining new Scheme predicates, Urs Liska, 2016/11/07
- Re: Defining new Scheme predicates, Urs Liska, 2016/11/07
- Re: Defining new Scheme predicates, David Kastrup, 2016/11/07
- Re: Defining new Scheme predicates, David Kastrup, 2016/11/07