Skip to main content
6 votes
Accepted

Best Practice - Where to declare variables in Common Lisp?

Your approach is correct: we bind (rather than declare, as in other languages) variables exactly where we need them. (In your case, however, you are using h-offset in the 1st half of your function, ...
sds's user avatar
  • 861
6 votes

Types in Lisp and Scheme

Typed Racket is very different from Haskell. Type systems in Lisp and Scheme, and indeed type systems in traditionally untyped language ecosystems in general, have a fundamental goal that other type ...
Jack's user avatar
  • 4,509
5 votes

SBCL development on Windows, including CFFI

This is a little late, but as of about 2 months ago (05/2018) I found this project called Portacle which bundles SBCL, Emacs, Quicklisp, and more into a single package for Windows 10. All you have to ...
λ Jonas Gorauskas's user avatar
5 votes
Accepted

In which order should lisp functions be defined?

For Common Lisp I'm using something like this: files are organized in systems and subsystems (see for example ASDF as a tool for that) you can put everything in one file, but that takes some care ...
Rainer Joswig's user avatar
3 votes
Accepted

Are multiple dynamic dispatch methods possible?

It's always possible There are lots of work-arounds to implement multi-methods in languages that don't support them: Some use dispatch tables. The most impressing is imho in Alexandrescu's Modern C++...
Christophe's user avatar
  • 78.4k
3 votes

Are multiple dynamic dispatch methods possible?

This is basically a fundamentally impossible problem: The fundamental idea of multiple dispatch is that all arguments that take part in the dispatch are equal, i.e. that there is no argument which is &...
Jörg W Mittag's user avatar
3 votes

Simple tic-tac-toe GUI in Common Lisp: Avoid using Continuation Passing Style?

I've written quite a bit of code like what you post and now that I'm older (wiser is debatable, I'm sure) I've realized that there was one key tension in designs like this. On the one hand you have ...
Michael's user avatar
  • 6,467
3 votes

In which order should lisp functions be defined?

Common Lisp has both COMPILE and COMPILE-FILE. An implementation like SBCL does not warn about undefined function if you compile the whole file, for example. Under slime, C-c M-k does not trigger a ...
coredump's user avatar
  • 5,965
2 votes
Accepted

Use `labels` or nested `flet`?

Generally Lisp is less dogmatic about programming style. Some programming style might not be desirable in hand-written code, but might be useful for generated code. Since generated code (-> macros) is ...
Rainer Joswig's user avatar
2 votes

Lisp: circular structure printing through user-defined print methods: what are the requirements?

The answer is: yes, but the printer is not required to sweep the whole image, only the objects provided to printing functions. Nothing forbids the Lisp printer from performing multiple passes or any ...
acelent's user avatar
  • 429
1 vote

Scheme's define in Common Lisp

You don't have to use LET when using DEFUN: you can define local variables in the parameter list: (defun foo (a) (let ((b (expt a 3))) (+ a b))) is also (defun foo (a &aux (b (expt a 3))) ...
Rainer Joswig's user avatar
1 vote

Should I introduce a data format with limited expressivity or use the full expressiveness of lisp?

There are companies (e.g. Franz Inc.) that successfully sell both Common Lisp (e.g. Allegro Common Lisp) and a graph database (e.g. AllegroGraph). There is cl-neo4j, an interface to the neo4j graph ...
Kasper van den Berg's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible