- **status**: Accepted --> Duplicate
- **assigned_to**: David Kastrup
- **Patch**: needs_work -->  
- **Type**: Enhancement --> Maintainability
- **Comment**:

I've marked this as "Duplicate" since I folded the contents of the last patch 
into various other issues (such as issue 5052) and converted a number of TODO 
comments into appropriate issues as well.  As it stands, I think the last patch 
should more or less completely be turned into code or code proposals.



---

** [issues:#4342] Patch: Replace C++ (in)equality checks with proper SCM 
syntax**

**Status:** Duplicate
**Created:** Tue Apr 07, 2015 06:15 AM UTC by Anonymous
**Last Updated:** Sat Oct 31, 2015 10:23 PM UTC
**Owner:** David Kastrup


*Originally created by:* *anonymous

*Originally created by:* [v.villenave](http://code.google.com/u/v.villenave/)
*Originally owned by:* [v.villenave](http://code.google.com/u/v.villenave/)

Replace C++ (in)equality checks with proper SCM syntax

This commit replaces the most straightforward situations
where two SCM objects are compared.  Here are the basic
replacements I used:

    x == SCM_BOOL_F            --->            scm_is_false (x)
    x == SCM_BOOL_T            --->            to_boolean (x)

(I’d rather use something more straightforward such as `scm_is_true (x)`, but 
accordingly to the CG this is The LilyPond Way®.)

    x == (SCM y)               --->            scm_is_eq (x, y)
(often used with `ly_symbol2scm`)

I’m also adding some functions that Guile v1 does not provide:

    x == SCM_EOL               --->            ly_is_eol (x)
    x == SCM_UNDEFINED         --->            ly_is_undefined (x)
    (scm_exact_p (x)) == SCM_BOOL_T   ---->    ly_is_exact (x)

Finally, I replaced `(!cached)` with `(!SCM_UNPACK (cached))` in 
`lily-guile-macros.hh`, as has been suggested once by David.

Please note that this commit does not handle some situations I’m less 
comfortable with (namely those involving `scm_c_memq`, `scm_assq` or 
`scm_hashq_get_handle`), and some `scm_*_p` checks for which there isn’t a 
`ly_is_*` replacement yet (to wit, `scm_hash_table_p`, `scm_promise_p`, and 
`scm_variable_bound_p`). Those should be dealt with later (preferably with help 
from more experienced people than yours truly).

http://codereview.appspot.com/226840043


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/testlilyissues/issues/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/testlilyissues/admin/issues/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Testlilyissues-auto mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/testlilyissues-auto

Reply via email to