Search found 133 matches
You can randomize it with sort:
Code: Select all
(defparameter *lst* (list a b c d)) ; list of the elements (setf *lst* (sort *lst* (lambda (&rest lst) (< 0.5 (random 1.0)))))
Only the formatting is copyrighted by ANSI, not the content. The standards textual content is in the public domain according to Kent M. Pitman. He writes in Common Lisp: The untold story that he was asked to transfer copyright to ANSI committee, but he refused since it wasn't his to give. 6.2 ANSI a...
Hello I had the same experience as you. I know a lot of languages and knowing how easy it was learning them I though it would be easy to just find out how to do <java feature> in lisp and just program in the same way. The reason it doesn't work is because I only knew many dialects of ONLY ONE progra...
- Sun May 31, 2015 11:07 am
- Forum: Homework
- Topic: my-union (Touretzky / exercise 8.52.)
- Replies: 4
- Views: 8603
It's common for function to share structure so I wouln't say your solution is wrong. The main differences perhaps is that the elements in the result are not in the same order. Sets are not usually ordered so I can't see how that would be wrong either. You can also make a tail recursive solution like...
- Sat May 09, 2015 1:12 pm
- Forum: Common Lisp
- Topic: SBCL: List of format control directives
- Replies: 3
- Views: 5065
This is an implementation of the standard procedure *list*. I believe it does what you want. (define (my-list . args) args) (my-list 1 2 3 4) ; ==> (1 2 3 4) Notice that you have posted this in the Scheme section so this is a Scheme implementation. Scheme uses the word procedure instead of function.
- Thu Apr 09, 2015 6:52 pm
- Forum: Scheme
- Topic: Scheme Executable Terminating Prematurely
- Replies: 3
- Views: 7020
DrRacket is a implementation that supports several languages. It's main language is #lang racket or #!racket for short and it is not Scheme. If you wanrt Scheme as in a standard language you need to use #!r5rs or #r6rs #lang scheme was the same as #!racket , thus not Scheme at all, and it's deprecat...
- Fri Feb 06, 2015 5:07 pm
- Forum: Scheme
- Topic: Is there an easy-to-use compiler for Scheme?
- Replies: 2
- Views: 6104
I agree DrRacket does indeed work as a good IDE/editor. It also has macroexpansion and a good debugger as well as function as a compiler. Be sure to not use the standard language though as it is *not* Scheme. The latest Scheme report supported by the suit is R6RS. If you need to test your software o...
Integers don't have base when they are stored. Your reader can read numbers in several different bases. (+ 10 #xa #b1010) ; ==> 30 Now when makeing a string out of the number you get to choose the base: (let ((thirty (+ 10 #xa #b1010))) (format nil "~n ~x ~o ~b" thirty thirty thirty thirty)) ; ==> "...