output_locateobj.lisp

output_locateobj.lisp - if (eql x obj) collect (list x i)...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
A:\UMN\AI\output_locateobj.lisp.txt Wednesday, November 02, 2011 9:22 AM The output from LISP interpreter Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/> 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]> ; Balaji, FNU ; Student ID: 4287938 ; Extra Credit Assignment 3 (defun locateobj (obj l) (if (null l) nil (loop for i from 1 to (length l) for x in l
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if (eql x obj) collect (list x i) if (eql x obj) collect x into result finally (print(length result)) ) ) ) LOCATEOBJ [2]&gt; (locateobj'y '( a b c d e)) NIL [3]&gt; (locateobj'y '( x y z 1 2 3)) 1 ((Y 2)) [4]&gt; (locateobj'y '( x y z a y b)) 2 ((Y 2) (Y 5)) [5]&gt; (locateobj'y '( x y z y u i y q y t a s d f y y y y y y z d y l y x y y y y)) 16 ((Y 2) (Y 4) (Y 7) (Y 9) (Y 15) (Y 16) (Y 17) (Y 18) (Y 19) (Y 20) (Y 23) (Y 25) (Y 27) (Y 28) (Y 29) (Y 30))-1-A:\UMN\AI\output_locateobj.lisp.txt Wednesday, November 02, 2011 9:22 AM [6]&gt; (locateobj'y '( )) NIL [7]&gt;-2-...
View Full Document

This note was uploaded on 11/21/2011 for the course ECON 229 taught by Professor John during the Spring '11 term at Globe.

Page1 / 2

output_locateobj.lisp - if (eql x obj) collect (list x i)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online