Search found 133 matches

by sylwester
Thu May 12, 2016 5:51 am
Forum: The Lounge
Topic: Lisp to C converter.
Replies: 4
Views: 8299

Re: Lisp to C converter.

Since you are using the extension .cl on your examples is the language a superset of CL or is the power of CL only used in it's implementation?
by sylwester
Sun Apr 10, 2016 4:25 pm
Forum: Common Lisp
Topic: Genetic algorithms
Replies: 5
Views: 6911

Re: Genetic algorithms

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)))))
by sylwester
Thu Jan 21, 2016 5:27 am
Forum: Common Lisp
Topic: Common Lisp HyperSpec
Replies: 5
Views: 7623

Re: Common Lisp HyperSpec

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...
by sylwester
Wed Jan 20, 2016 7:57 am
Forum: The Lounge
Topic: Hello
Replies: 2
Views: 6381

Re: Hello

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...
by sylwester
Sun May 31, 2015 11:07 am
Forum: Homework
Topic: my-union (Touretzky / exercise 8.52.)
Replies: 4
Views: 8603

Re: my-union (Touretzky / exercise 8.52.)

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...
by sylwester
Sat May 09, 2015 1:12 pm
Forum: Common Lisp
Topic: SBCL: List of format control directives
Replies: 3
Views: 5065

Re: SBCL: List of format control directives

In the book Practical Common Lisp you have the chapter A few FORMAT recipes

It's not a documentation but some receipes for a bunch of scenarios that usually comes up. I haven't tried to understand it all myself but I use this regulary.
by sylwester
Sat May 09, 2015 1:01 pm
Forum: Scheme
Topic: help needed
Replies: 1
Views: 8719

Re: help needed

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.
by sylwester
Thu Apr 09, 2015 6:52 pm
Forum: Scheme
Topic: Scheme Executable Terminating Prematurely
Replies: 3
Views: 7020

Re: Scheme Executable Terminating Prematurely

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...
by sylwester
Fri Feb 06, 2015 5:07 pm
Forum: Scheme
Topic: Is there an easy-to-use compiler for Scheme?
Replies: 2
Views: 6104

Re: Is there an easy-to-use compiler for Scheme?

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...
by sylwester
Fri Nov 28, 2014 4:31 pm
Forum: Common Lisp
Topic: Binary operations in Lisp
Replies: 3
Views: 4827

Re: Binary operations in Lisp

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)) ; ==> "...