How can I specifically check for dotted-lists in the form (a . b)
Guile? The dotted-list
of srfi-1 strangely returns #t also for e.g. Numbers (since when are numbers Lists too? https://www.gnu.org/software/guile/manual/html_node/SRFI_002d1-Predicates.html)! And pair?
will evaluate to #t also for normal lists. Is there a way to differentiate the (a . b)
construct from other things, whereas the b
part (the cdr) could itself be any object including other association lists etc.?
This is what i didn't expect and can't understand:
(dotted-list? '(c . ((d . 3)
(e . 4)))) ; ===> #f
(dotted-list? 3) ; ===> #t