;;;; TASK VII: TAKE-FROM (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]> ( take-from 'a ( a b c d c b a b ) ) *** - EVAL: undefined function A The following restarts are available: USE-VALUE :R1 Input a value to be used instead of (FDEFINITION 'A). RETRY :R2 Retry STORE-VALUE :R3 Input a new value for (FDEFINITION 'A). ABORT :R4 Abort main loop Break 1 [3]> :a [4]> ( take-from 'a '( a b c d c b a b ) ) (B C D C B B) [5]> ( take-from 1 '( 1 11 3 2 1 0 ) ) (11 3 2 0) [6]> ( take-from 'jerry '( tom jerry jeremy ) ) (TOM JEREMY) [7]> ( trace take-from ) ;; Tracing function TAKE-FROM. (TAKE-FROM) [8]> ( take-from 24 '( twenty-four 2 4 24 two four ) ) 1. Trace: (TAKE-FROM '24 '(TWENTY-FOUR 2 4 24 TWO FOUR)) 2. Trace: (TAKE-FROM '24 '(2 4 24 TWO FOUR)) 3. Trace: (TAKE-FROM '24 '(4 24 TWO FOUR)) 4. Trace: (TAKE-FROM '24 '(24 TWO FOUR)) 5. Trace: (TAKE-FROM '24 '(TWO FOUR)) 6. Trace: (TAKE-FROM '24 '(FOUR)) 7. Trace: (TAKE-FROM '24 'NIL) 7. Trace: TAKE-FROM ==> NIL 6. Trace: TAKE-FROM ==> (FOUR) 5. Trace: TAKE-FROM ==> (TWO FOUR) 4. Trace: TAKE-FROM ==> (TWO FOUR) 3. Trace: TAKE-FROM ==> (4 TWO FOUR) 2. Trace: TAKE-FROM ==> (2 4 TWO FOUR) 1. Trace: TAKE-FROM ==> (TWENTY-FOUR 2 4 TWO FOUR) (TWENTY-FOUR 2 4 TWO FOUR) [9]> (bye) Bye.