[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Defining new Scheme predicates
From: |
Urs Liska |
Subject: |
RE: Defining new Scheme predicates |
Date: |
Mon, 07 Nov 2016 06:45:19 +0100 |
User-agent: |
K-9 Mail for Android |
Am 7. November 2016 01:20:23 MEZ, schrieb 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.
Not at all!
Just define your predicate with
#(define (side? obj)
(if (or (eq? obj 'left)
(eq? obj 'right))
#t #f))
and use it like any other procedure. The ? at the end is just a convention,
predicates are nothing else than procedures taking one argument and returning
#t or #f.
HTH
Urs
(As with Simon this is untested and written on the mobile)
>
>Andrew
>
>
>
>
>
>_______________________________________________
>lilypond-user mailing list
>address@hidden
>https://lists.gnu.org/mailman/listinfo/lilypond-user
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
- 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, 2016/11/06
- RE: Defining new Scheme predicates,
Urs Liska <=
- 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