Scheme function (third) used in ly_syntax_constructors

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Scheme function (third) used in ly_syntax_constructors

Ian Hulin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

In ly_syntax_constructors.scm there are these lines

(defmacro define-ly-syntax-loc (args . body)
  `(define-public ,args
     (let ((m ,(cons 'begin body)))
       (set! (ly:music-property m 'origin) ,(third args))
;;                                           ^^^^^^^^^^
       m)))

(third) doesn't seem to be defined in our code (I've searched with git
grep), and I can't find any reference in the Guile/scheme documentation.

I'd like to understand what this macro does as I want to see if there's
any possibility of doing all the stuff in ly_syntax_constructors stuff
via (define-syntax).

Sorry if the answer is really obvious but I'd really like to know where
(third) is defined.

Cheers,

Ian Hulin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNKj9xAAoJEBqidDirZqASzAwIALF11q2v9qMiSuLt1Spp+19S
j2bX2bxFbdEak+MPFLTj3lLwls3LsG82Yefu0QvD+3aZ71cRJXLgEGtfUox6B+w/
QTAgnexAySoUwiYUlotVVm87+ibQpeTyDOuT9mIoyoOlGi/0Hm8dg5mRWelsE37H
tT7UjSWGHOYKUNdX2zrUvF9rURj/HK4duYJfejkmbyVgR4cX+1fY7bb6KyVLSmt5
MjjcaGGjyZ4Q6CqIT7NhYU6k5D3BJFblqsQP87k+1bKiGAH7LYeouxOp9iqsi2/b
6FW6Rgya3lFcY+Zw4aYpHltjOf+oCkOBbJqdRUBz7Wnt8mq+bqlOhUrQ+vQSeik=
=BbmQ
-----END PGP SIGNATURE-----

---
----
Join the Frogs!

Reply | Threaded
Open this post in threaded view
|

Re: Scheme function (third) used in ly_syntax_constructors

Felipe Gonçalves Assis
Hello Ian,

'third' is just a synonym for 'caddr', and it is part of SRFI-1,
which is implemented by Guile, the scheme interpreter used
in LilyPond.

See:
http://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Selectors.html#SRFI_002d1-Selectors
http://srfi.schemers.org/srfi-1/srfi-1.html#Selectors

Cheers,
Felipe

2011/1/9 Ian Hulin [via LilyPond Frogs]
<[hidden email]>:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> In ly_syntax_constructors.scm there are these lines
>
> (defmacro define-ly-syntax-loc (args . body)
>   `(define-public ,args
>      (let ((m ,(cons 'begin body)))
>        (set! (ly:music-property m 'origin) ,(third args))
> ;;                                           ^^^^^^^^^^
>        m)))
>
> (third) doesn't seem to be defined in our code (I've searched with git
> grep), and I can't find any reference in the Guile/scheme documentation.
>
> I'd like to understand what this macro does as I want to see if there's
> any possibility of doing all the stuff in ly_syntax_constructors stuff
> via (define-syntax).
>
> Sorry if the answer is really obvious but I'd really like to know where
> (third) is defined.
>
> Cheers,
>
> Ian Hulin
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJNKj9xAAoJEBqidDirZqASzAwIALF11q2v9qMiSuLt1Spp+19S
> j2bX2bxFbdEak+MPFLTj3lLwls3LsG82Yefu0QvD+3aZ71cRJXLgEGtfUox6B+w/
> QTAgnexAySoUwiYUlotVVm87+ibQpeTyDOuT9mIoyoOlGi/0Hm8dg5mRWelsE37H
> tT7UjSWGHOYKUNdX2zrUvF9rURj/HK4duYJfejkmbyVgR4cX+1fY7bb6KyVLSmt5
> MjjcaGGjyZ4Q6CqIT7NhYU6k5D3BJFblqsQP87k+1bKiGAH7LYeouxOp9iqsi2/b
> 6FW6Rgya3lFcY+Zw4aYpHltjOf+oCkOBbJqdRUBz7Wnt8mq+bqlOhUrQ+vQSeik=
> =BbmQ
> -----END PGP SIGNATURE-----
>
> ---
> ----
> Join the Frogs!
>
>
>
> ________________________________
> View message @
> http://lilypond-frogs.2124236.n2.nabble.com/Scheme-function-third-used-in-ly-syntax-constructors-tp5905482p5905482.html
> To start a new topic under LilyPond Frogs, email
> [hidden email]
> To unsubscribe from LilyPond Frogs, click here.
Reply | Threaded
Open this post in threaded view
|

Re: Scheme function (third) used in ly_syntax_constructors

Ian Hulin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Felipe,
On 10/01/11 00:02, Felipe Gonçalves Assis wrote:

>
> Hello Ian,
>
> 'third' is just a synonym for 'caddr', and it is part of SRFI-1,
> which is implemented by Guile, the scheme interpreter used
> in LilyPond.
>
> See:
> http://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Selectors.html#SRFI_002d1-Selectors
> http://srfi.schemers.org/srfi-1/srfi-1.html#Selectors
>
Many thanks for the clarification (blush)

Cheers,
Ian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNK2naAAoJEBqidDirZqASUIwH/iTmjuo8iqD6jjpBa9eaXh0n
Gt5j2jFCgVoufPuSkwvco03SJU6mK7WcqZtrIyKvz+eJZnDds6xfxI0rXtt2UqL3
fXgFlVsAbRA7ke0ufVbCDGFmzhjXhNUhOqhvM4+JYxpmWEI8gy2gC/7moP55vMBE
rRQlpMpCUc4cf/1EjqF5dhdFOUmcfSJZedrMq54s/WQJ5xPFuwGDnZ4TeGF/Rmnw
x0PkvFsLrq6tPVidsfsWg1gNrCdMnUL5+ZdR+VFv3Bp4kJKyjXg3aJFThCEFchO3
qBLvfU+FMRxzxIa2inx9N3w4f/9qbkPBA8M8lT4yQmXyCYe5ORc66mpXM3WDZmg=
=BeZz
-----END PGP SIGNATURE-----

---
----
Join the Frogs!