I wrote the following loop using local-time:It can be run simply like this:While this was easy and straightforward, I wanted to know how to write it without the all-powerful loop construct, and came up with:
I would like to try extending some Lisp (Scheme, Racket, Clojure, any) to run external commands as follows:
As a part of a Tic Tac Toe playing bot, I need a function that evaluates combinations of tiles to points. The code would look something like this:
Generics seem to offer a nice facility for pulling out a common word and letting it act on things according to the types you pass it, with extensibility after-the-fact.
So I performed macroexpand-1 on this function and I understand generally how this macro works, but I'm super confused of how Graham nest the backquote `, and how he uses ,@ to expand the cases.
I am trying to practise creating macros in Common Lisp by creating a simple += macro and an iterate macro. I have managed to create the += macro easily enough and I am using it within my iterate macro, which I am having a couple of issues with. When I...
I'm really new to common Lisp and having some struggles. I'm working on a function that given x, y and an array with the index for vertical value returns NIL if there's any element diagonal from (x y).
I want to open a file and read the contents, or do something else if the file does not exist.The former can be accomplished easily enough: with-open-file.
I am wondering if there is a way to get Linux's PID (Process ID) from Common Lisp's REPL. That is, I would like to know the ID of the SBCL or Allegro process from the REPL of the process itself.
Why happen this in sbcl? Maybe a bug?But if change :initform to :The problem disappearsI test this in sbcl 1.4.3 and 1.4.11. In clisp it seems that the problem does not arise.