Search found 20 matches

by logxor
Wed Nov 26, 2014 3:37 pm
Forum: Common Lisp
Topic: Optimizing Common Lisp Speed and executable Size
Replies: 4
Views: 5272

Re: Optimizing Common Lisp Speed and executable Size

Well, I doubt anyone's going to know why a function is slow without having some idea of what it does, or whether any variations on its implementation have been tried.
by logxor
Tue Nov 25, 2014 2:15 pm
Forum: Common Lisp
Topic: Problem in executing the code
Replies: 5
Views: 6144

Re: Problem in executing the code

Pro tip—you have no hope of understanding your own macros without MACROEXPAND-1. Try expanding the call form: ? (macroexpand-1 `(reverse-list (list(1 2 3 4 5)))) (IF (ATOM LIST (1 2 3 4 5)) LIST (1 2 3 4 5) (REVERSE (MAPCAR #'REVERSE-LIST LIST (1 2 3 4 5)))) Comma-at-sign is the splicing operator,...
by logxor
Wed Nov 05, 2014 6:33 pm
Forum: Homework
Topic: Problem with a Programm
Replies: 1
Views: 4902

Re: Problem with a Programm

I don't know Scheme but I'm guessing COND works the same way as in CL. You can test the month number with COND and, within the matching clause, validate the day number like so: (cond ((= month 1) (<= day 31)) ((= month 2) (<= day 28)) ((= month 3) (<= day 31)) ...) And, of course, return false if th...
by logxor
Tue Oct 14, 2014 3:01 pm
Forum: Common Lisp
Topic: Using an array to store commands [SOLVED]
Replies: 4
Views: 5148

Re: Using an array to store commands

The fdefinition accessor is what maps between functions and their names. Technically P-lists use symbols as keys, or at least keys that can be compared with EQ—which rules out strings unless you're interning them. A-lists can use arbitrary keys. If you have a lot of commands, you could try either ...
by logxor
Sat Oct 04, 2014 2:44 pm
Forum: Common Lisp
Topic: cursing curses in clisp
Replies: 5
Views: 7551

Re: cursing curses in clisp

This old thread from the CLISP mailing list has a snippet involving SCREEN and keyboard input. On this German site there's a peg solitaire thing using CLISP's built-in screen interface. I have no idea if it works or not, but I'm just pasting the source file here: (defun ChooseVariant() (screen:clea...
by logxor
Fri Oct 03, 2014 11:29 am
Forum: Common Lisp
Topic: cursing curses in clisp
Replies: 5
Views: 7551

Re: cursing curses in clisp

Judging from the online documentation, UFFI doesn't support CLISP . That page suggests using the "cffi-uffi-compat" component of CFFI. Or you could investigate this project I just saw: cl-charms , which is a newer curses interface built with CFFI instead of UFFI. Also—it looks like there's a simpl...
by logxor
Mon Sep 29, 2014 12:14 pm
Forum: Other Dialects
Topic: Symbolics and lisp machines.
Replies: 2
Views: 6965

Re: Symbolics and lisp machines.

There's an old thread about the Symbolics Genera OS. The Symbolics stuff is proprietary, though there's source code and hardware design for the MIT CADR Lisp machine available for browsing. It's a lot of archaic and low-level code, but some of it does make for interesting reading.
by logxor
Sat Sep 27, 2014 4:13 pm
Forum: Common Lisp
Topic: how to dump a list to a file [SOLVED]
Replies: 1
Views: 3212

Re: how to dump a list to a file [SOLVED]

That's a good way to put it—what makes Common Lisp unique. It gets rid of artificially imposed constraints that come either from ideology, or from a preoccupation with particular kinds of problems or ways of problem-solving, which tend to be encoded into other programming languages at the expense ...
by logxor
Sun Sep 14, 2014 3:55 pm
Forum: Common Lisp
Topic: How does CFFI handle returned string?
Replies: 2
Views: 3124

Re: How does CFFI handle returned string?

I don't have CFFI handy to try this out, but it appears that the :STRING type takes a :FREE-FROM-FOREIGN option that specifies whether to free the foreign string after it's been translated to a Lisp string. The default is NIL, so: (cffi:defcfun ("linkage_print_diagram" linkage_print_diagram) (:strin...