The filter is not associated with the chicken circuit. What for?

I start with the chicken scheme. The code below works in mit circuit repl-circuit, but not with csi. csi has a filter defined in the docs, but I get an unbound variable error when running the code below.

    CHICKEN
(c) 2008-2015, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.10.0 (rev b259631)
macosx-unix-clang-x86-64 [ 64bit manyargs dload ptables ]
compiled 2015-08-04 on yves.more-magic.net (Linux)

#;1> (filter odd? '(1 2 3 ))

Error: unbound variable: filter

    Call history:

    <syntax>          (filter odd? (quote (1 2 3)))
    <syntax>          (quote (1 2 3))
    <syntax>          (##core#quote (1 2 3))
    <eval>    (filter odd? (quote (1 2 3))) <--
#;1>
+4
source share
2 answers

filteris defined in a modulesrfi-1 , so you must first load this module to make it available:

CHICKEN
(c) 2008-2014, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.9.0.1 (stability/4.9.0) (rev 8b3189b)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
bootstrapped 2014-06-07

#;1> (use srfi-1)
; loading /var/lib//chicken/7/srfi-1.import.so ...
; loading library srfi-1 ...
#;2> (filter odd? '(1 2 3 ))
(1 3)
#;3>
+4
source

Not sure which procedure filteryou are referring to, but it seems that one of the ones filterlisted in the document is only available during macros:

http://api.call-cc.org/doc/bindings#sec:filter

, , SRFI-1. , :

(use srfi-1)

+4

Source: https://habr.com/ru/post/1606198/


All Articles