aconchillo / guile-redis

Redis module for Guile
GNU General Public License v3.0
29 stars 4 forks source link

Fails to compile with Guile 3.0.7 because of #nil #7

Closed rekado closed 3 years ago

rekado commented 3 years ago

redis/command.scm uses #nil, which causes Guile 3.0.7 to fail compiling it. Replacing #nil with (list) fixes the problem.

rekado commented 3 years ago

This might be related: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48315

aconchillo commented 3 years ago

Thank you! Yeah, it seems #nil is not working inside macros...

Should be fixed in 2.1.1.

rekado commented 3 years ago

Excellent, thank you!

TaylanUB commented 3 years ago

@aconchillo Please note that #nil was only added to Guile as an Elisp compatibility hack and the general idea is that it should never be used explicitly in Scheme. Either #f or '() or something more appropriate based on context should be used.

(An arguably acceptable exception that I heard someone mention recently is using it when porting Common Lisp code, but even then it's best to phase out uses of #nil as one improves the ported code, i.e. it should be a temporary band-aid only.)

The reason that #nil seems like it doesn't properly "work" in some macros is that the pattern matching recognizes it as an empty list, meaning for instance that the pattern (x ...) will match #nil. (See bug linked by rekado above.) And that's probably how it should really be, because a macro might process syntax objects that came from Elisp-land. (Write a macro in Scheme, use it in Elisp...)

aconchillo commented 3 years ago

@TaylanUB Thank you for the details, I had no idea about this. I'll stop using #nil then.

aconchillo commented 3 years ago

2.1.2 released: just removed all instances of #nil and fix another bug regarding empty string responses.