Bertrand Bordage <bordage.bertr...@gmail.com> writes:

> This would be great if Han-Wen decides to keep it like that.
> Otherwise there is really a lot of work, with many shortcuts to
> define.
> to_boolean (scm_is_pair (x))

That one would be wrong since scm_is_pair already returns a C boolean.

 -- C Function: int scm_is_pair (SCM x)
     Return 1 when X is a pair; otherwise return 0.

And if you are worried about speed:

 -- Macro: int SCM_CONSP (SCM X)
     Return non-zero iff X is a Scheme pair object.

 -- Macro: int SCM_NCONSP (SCM X)
     The complement of SCM_CONSP.

> to_boolean (scm_list_p (x)) && !to_boolean (scm_null_p (x))

Sounds like SCM_CONSP should usually do fine (though it does not
distinguish proper and improper lists).  And I don't see that there is a
"dirty" shortcut for that particularly check either.

-- 
David Kastrup


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to