Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local function CAR-SAFE is redundant/misnamed #119

Open
phoe opened this issue Feb 6, 2022 · 1 comment
Open

Local function CAR-SAFE is redundant/misnamed #119

phoe opened this issue Feb 6, 2022 · 1 comment

Comments

@phoe
Copy link
Contributor

phoe commented Feb 6, 2022

See #55

(flet ((car-safe (x) (if (consp x) (car x) x)))

This is equivalent to ALEXANDRIA:ENSURE-CAR.

This local function's name is also a bad misnomer, since SERAPEUM:CAR-SAFE explicitly does something else than ALEXANDRIA:ENSURE-CAR in the atom case.

@phoe phoe changed the title Local functions CAR-SAFE are redundant/misnamed Local function CAR-SAFE is redundant/misnamed Feb 6, 2022
@phoe
Copy link
Contributor Author

phoe commented Feb 6, 2022

In terms of fixing #55, won't it be better in the long-term to get rid of the local functions and wrap the real SAFE-CAR in an EVAL-ALWAYS? The fewer local functions we have, the fewer places for bugs like that to hide in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant