;;;; TASK VI: FILTER-IN -- FILTER-OUT (DEMO) i i i i i i i ooooo o ooooooo ooooo ooooo I I I I I I I 8 8 8 8 8 o 8 8 I \ `+' / I 8 8 8 8 8 8 \ `-+-' / 8 8 8 ooooo 8oooo `-__|__-' 8 8 8 8 8 | 8 o 8 8 o 8 8 ------+------ ooooo 8oooooo ooo8ooo ooooo 8 Welcome to GNU CLISP 2.49 (2010-07-07) Copyright (c) Bruno Haible, Michael Stoll 1992, 1993 Copyright (c) Bruno Haible, Marcus Daniels 1994-1997 Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998 Copyright (c) Bruno Haible, Sam Steingold 1999-2000 Copyright (c) Sam Steingold, Bruno Haible 2001-2010 Type :h and hit Enter for context help. [1]> (load "lp.l") ;; Loading file lp.l ... ;; Loaded file lp.l T [2]> ( filter-in 'numberp '( a 1 b 2 c 3 d )) (1 2 3) [3]> ( filter-in 'oddp '( 1 2 3 4 5 6 7 8 9 10 )) (1 3 5 7 9) [4]> ( filter-in 'atom '( 1 2 (3 4 5 6 7) 8 9 10 )) (1 2 8 9 10) [5]> ( trace filter-in ) ;; Tracing function FILTER-IN. (FILTER-IN) [16]> ( filter-in 'symbolp '( elephant 12 nil )) 1. Trace: (FILTER-IN 'SYMBOLP '(ELEPHANT 12 NIL)) 2. Trace: (FILTER-IN 'SYMBOLP '(12 NIL)) 3. Trace: (FILTER-IN 'SYMBOLP '(NIL)) 4. Trace: (FILTER-IN 'SYMBOLP 'NIL) 4. Trace: FILTER-IN ==> NIL 3. Trace: FILTER-IN ==> (NIL) 2. Trace: FILTER-IN ==> (NIL) 1. Trace: FILTER-IN ==> (ELEPHANT NIL) (ELEPHANT NIL) [21]> ( filter-out 'oddp '( 1 2 3 4 5 6 7 8 9 10 ) ) (2 4 6 8 10) [22]> ( filter-out 'listp '( (1 2) 3 4 5 6 )) (3 4 5 6) [25]> ( filter-out 'zerop '( 1 0 2 0 3 0 )) (1 2 3) [26]> ( trace filter-out ) ;; Tracing function FILTER-OUT. (FILTER-OUT) [27]> ( filter-out 'atom '( 3 6 9 (12 15 18) 21 24 ) ) 1. Trace: (FILTER-OUT 'ATOM '(3 6 9 (12 15 18) 21 24)) 2. Trace: (FILTER-OUT 'ATOM '(6 9 (12 15 18) 21 24)) 3. Trace: (FILTER-OUT 'ATOM '(9 (12 15 18) 21 24)) 4. Trace: (FILTER-OUT 'ATOM '((12 15 18) 21 24)) 5. Trace: (FILTER-OUT 'ATOM '(21 24)) 6. Trace: (FILTER-OUT 'ATOM '(24)) 7. Trace: (FILTER-OUT 'ATOM 'NIL) 7. Trace: FILTER-OUT ==> NIL 6. Trace: FILTER-OUT ==> NIL 5. Trace: FILTER-OUT ==> NIL 4. Trace: FILTER-OUT ==> ((12 15 18)) 3. Trace: FILTER-OUT ==> ((12 15 18)) 2. Trace: FILTER-OUT ==> ((12 15 18)) 1. Trace: FILTER-OUT ==> ((12 15 18)) ((12 15 18)) [28]> (bye) Bye.