Search found 94 matches

by Kompottkin
Thu Aug 08, 2013 5:55 am
Forum: Common Lisp
Topic: Question on methods and setting
Replies: 9
Views: 8239

Re: Question on methods and setting

Each more detailed level of analysis adds another dimension of data. Thus the slots of the clos objects in level 2 contain vectors, the slots in level 3 contain 2 dimensional arrays, the slots in level 4 contain 3 dimensional arrays. So the first level ought to contain 0-dimensional arrays. :) (let...
by Kompottkin
Tue Aug 06, 2013 1:38 pm
Forum: Common Lisp
Topic: Question on methods and setting
Replies: 9
Views: 8239

Re: Question on methods and setting

Because Lisp always passes references to objects (by value). Therefore, you can modify objects passed to you, but not the references to those objects. Your array method modifies the passed vector, which is an effect that is visible to the caller. Your number method modifies a locally bound reference...
by Kompottkin
Tue Aug 06, 2013 6:54 am
Forum: Common Lisp
Topic: Question on methods and setting
Replies: 9
Views: 8239

Re: Question on methods and setting

Lisp is call-by-value, not call-by-reference. In (defmethod add-something ((x number) y) (setf x (+ x y))) the variable x is local to the method. When the method is called, (a pointer to) the argument object is copied into the x variable. There is no way for add-something to modify whatever the plac...
by Kompottkin
Mon Jun 03, 2013 2:10 am
Forum: Common Lisp
Topic: Setting up an environment on OSX
Replies: 3
Views: 4634

Re: Setting up an environment on OSX

Here's my usual procedure (assuming the Xcode tools are installed): # Install Homebrew $ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" # Install SBCL and Emacs $ brew install sbcl $ brew install emacs --cocoa --srgb $ brew linkapps # Install Quicklisp and SLIME $ curl -O - http://b...
by Kompottkin
Sun May 12, 2013 6:52 am
Forum: Common Lisp
Topic: When does lisp use binary vs. base-10?
Replies: 4
Views: 5718

Re: When does lisp use binary vs. base-10?

Numbers don't have a base. Printed representations of numbers have a base. Thus, base is relevant only when reading and printing numbers. Decimal 5 is the same number as binary 101 (the number five). It's not a conversion. It's the same number. Lisp always reads numbers according to the current *re...
by Kompottkin
Fri Apr 26, 2013 8:39 am
Forum: The Lounge
Topic: Hello, am I even in the right place?
Replies: 9
Views: 18741

Re: Hello, am I even in the right place?

You're most welcome! :) Both CLISP and LispWorks are implementations of the language Common Lisp. There are various other implementations of Common Lisp, like SBCL, ECL, Allegro CL, and Clozure CL. Common Lisp is a wonderful language. I tend to use it for basically everything. I would still recommen...
by Kompottkin
Thu Apr 25, 2013 9:53 am
Forum: The Lounge
Topic: Hello, am I even in the right place?
Replies: 9
Views: 18741

Re: Hello, am I even in the right place?

I strongly believe that Lisps are great first languages (especially as compared to C++). My personal suggestion would be getting a copy of Racket and working through How to Design Programs, 2nd Edition (HtDP2) . ( Note #1 : There are little info boxes to the right of the text. Don't overlook them! N...
by Kompottkin
Wed Apr 24, 2013 7:34 am
Forum: Scheme
Topic: Simply Scheme Exercises. Chapter 06 True and False.
Replies: 3
Views: 8722

Re: Simply Scheme Exercises. Chapter 06 True and False.

korekaradesu wrote:1. Any non false value is true in Scheme.
Yes. And empty? is non-false (it's not #f but a function).
by Kompottkin
Fri Apr 12, 2013 12:13 am
Forum: Common Lisp
Topic: newbie question: compilation warning
Replies: 2
Views: 3533

Re: newbie question: compilation warning

Do you really need to use require ? It's deprecated. If you want to make use of libraries, use Quicklisp . Anyway, the documentation page referenced by the error message tells you what you need to do to fix the issue: Wrap the require form in an eval-when . Like this: (eval-when (:compile-toplevel :...
by Kompottkin
Thu Apr 11, 2013 7:02 am
Forum: The Lounge
Topic: SBCL is in Google Summer of Code
Replies: 1
Views: 3899

Re: SBCL is in Google Summer of Code

Clojure is in there, too.