Search found 271 matches
- Mon Mar 14, 2016 6:12 am
- Forum: Common Lisp
- Topic: New to LISP
- Replies: 3
- Views: 9491
Re: New to LISP
Or you can take more functional approach and return a lambda function so instead of: (defun find-closest-in-grid (radar type pos-x pos-y) (labels ((distance (x y) (+ (abs (- x pos-x)) (abs (- y pos-y))))) (destructuring-bind (width height) (array-dimensions radar) (let ((best nil) ((best-distance (+...
- Thu Mar 10, 2016 1:04 pm
- Forum: Common Lisp
- Topic: Reading a file, store it and display it
- Replies: 5
- Views: 13087
Re: Reading a file, store it and display it
The definition of a function in Common Lisp consists of defun the name of function a list of arguments and an implicit progn The value of a progn expression is the last expression in that progn . That means if you want return the 'dico' in your function, just write it down as a last expression in th...
- Thu Mar 03, 2016 10:48 am
- Forum: Homework
- Topic: Help for the first program of a newbie
- Replies: 1
- Views: 7218
Re: Help for the first program of a newbie
Here is a good article for the indentation of Common Lisp, that should be fine for scheme/racket too. Changing variables is done through set! (the exclamation mark denotes that the function has side effects): (define x 0) (set! x 1) What concerns the pairs and / and? and not / not? , without questi...
- Tue Feb 23, 2016 5:30 am
- Forum: Common Lisp
- Topic: intern and quoted symbols
- Replies: 3
- Views: 9567
Re: intern and quoted symbols
That's pretty much that. However there is another possibility how to make uninterned symbol:
Code: Select all
#:uninterned-symbol
- Wed Feb 03, 2016 4:15 am
- Forum: Common Lisp
- Topic: Is #S(quux ...) a literal?
- Replies: 5
- Views: 13351
Re: Is #S(quux ...) a literal?
Can you describe what SBCL is doing? I have right now installed pretty old version 1.1.12. Nevertheless, sharpsign syntax denotes a reader macro and that means it is by a standard way evaluated before the quasiquotation takes a place or in other words the quasiquotation doesn't stop evaluating reade...
- Sun Jan 31, 2016 4:36 am
- Forum: Common Lisp
- Topic: cl-json
- Replies: 3
- Views: 11144
Re: cl-json
If you want iterate over the keys in CLOS objects you'd need MOP . However I'd go for hashtables and setup cl-json this way: (json:set-decoder-simple-clos-semantics) (setf json:prototype nil) (multiple-value-setq (json:*beginning-of-object-handler* json:*object-key-handler* json:*object-value-handle...
- Sat Jan 30, 2016 6:29 am
- Forum: Common Lisp
- Topic: cl-json
- Replies: 3
- Views: 11144
Re: cl-json
After a little bit of experimentation, I come with this: ; SLIME 2014-12-23 CL-USER> (ql:quickload :cl-json) To load "cl-json": Load 1 ASDF system: cl-json ; Loading "cl-json" [package json].................................... [package json-rpc]................ (:CL-JSON) CL-USER...
- Thu Jan 21, 2016 5:51 am
- Forum: Common Lisp
- Topic: Common Lisp HyperSpec
- Replies: 5
- Views: 14004
Re: Common Lisp HyperSpec
Huh, good to know the terms and the story.
- Thu Jan 14, 2016 2:12 pm
- Forum: Common Lisp
- Topic: Common Lisp HyperSpec
- Replies: 5
- Views: 14004
Re: Common Lisp HyperSpec
I finally found out about the mutual rights' relationship (actually it's also noted in CLHS), CLHS existence is permitted by ANSI and X3. The stance on the distribution of CLHS is also described there , I'm by no means an expert on copyright laws, but I'd say that you can use it in a complete and un...
- Wed Oct 21, 2015 12:28 pm
- Forum: The Lounge
- Topic: PROLOG FORUM?
- Replies: 6
- Views: 32180
Re: PROLOG FORUM?
Here we are in The Lounge, it seams ok. I personally don't mind prolog oriented discussions here.