Search found 98 matches

by JamesF
Wed Jun 15, 2011 4:19 pm
Forum: Common Lisp
Topic: Print something in file
Replies: 9
Views: 4480

Re: Print something in file

Two consistent problems in your code are that you're using setq where you should be using let, and that you're using C-style parenthesis closing instead of lisp-style. The latter issue is just a stylistic one, but it does make it harder for us to read your code. I think you should also re-read the d...
by JamesF
Thu May 19, 2011 4:14 pm
Forum: Common Lisp
Topic: Newbie: How to add my own helper functions permantly?
Replies: 6
Views: 2095

Re: Newbie: How to add my own helper functions permantly?

Sorry, I tried posting this reply yesterday, but lispforum.com was having some issues with responding in a sane way.
by JamesF
Thu May 19, 2011 4:13 pm
Forum: Common Lisp
Topic: Newbie: How to add my own helper functions permantly?
Replies: 6
Views: 2095

Re: Newbie: How to add my own helper functions permantly?

Duke is right, at least while your collection of helper functions is relatively small - the RC file (e.g. .sbclrc) is a handy place to put them. That's where I keep a function for setting up linedit, because I normally only want it in interactive sessions where I'm not using VIlisp. If you start rel...
by JamesF
Mon May 16, 2011 6:33 pm
Forum: Common Lisp
Topic: Convert integer to bit array and vice versa?
Replies: 8
Views: 16322

Re: Convert integer to bit array and vice versa?

Just to make sure we're helping you solve the right problem here, what are you actually trying to do? It may be that CL just has a different way of solving that problem that other languages tackle via bit-vectors.
by JamesF
Sun May 15, 2011 7:12 pm
Forum: Common Lisp
Topic: Best way to compare parameter members
Replies: 3
Views: 1311

Re: Best way to compare parameter members

Your question is a little vague, but I'll answer it as best I can. For any given function, its parameter names are just convenient handles for the values that are passed in, bearing in mind that CL is a pass-by-reference language. If two of those parameters happen to be lists, then they're lists and...
by JamesF
Mon May 02, 2011 4:17 pm
Forum: Common Lisp
Topic: Keep running (don't exit after last line of code executes)
Replies: 4
Views: 1608

Re: Keep running (don't exit after last line of code executes)

I have an /etc/init.d/script that wraps around this and takes care of startup/shutdown at system boot/shutdown, but the code I use to kick off a hunchentoot server looks like this: #!/bin/bash # Starts up SBCL in a detached `screen` session, allowing you to # reattach at will, so long as you log in ...
by JamesF
Sun Feb 27, 2011 7:15 pm
Forum: Common Lisp
Topic: Newbie question 'bout car/cdr
Replies: 2
Views: 1111

Re: Newbie question 'bout car/cdr

These functions are often confusing, which is why people usually tell you not to use them. I use them myself sometimes, so I'll just suggest that you think them through very carefully. It may help to decompose it step-by-step: (cadr (foo)) becomes (car (cdr foo)) So (cadr ’(a ’(b (c)))) becomes ...
by JamesF
Mon Feb 21, 2011 3:46 pm
Forum: Common Lisp
Topic: authentication framework for hunchentoot ?
Replies: 2
Views: 1359

Re: authentication framework for hunchentoot ?

Likewise, I've written my own; I could probably extract it for you if you'd like, but they're not too hard to write. I call on Hunchentoot's built-in session handling, and use that session identifier as the primary key/slot in a Postmodern DAO. I check for an existing session with that primary key a...
by JamesF
Sat Feb 12, 2011 5:45 pm
Forum: Common Lisp
Topic: ANN: mark-and-render
Replies: 4
Views: 1451

Re: ANN: mark-and-render

By s-expr you actually mean 'a string whose contents resemble an s-expr' right? (or do you mean an s-expr built from lists). Erm, kinda both. A section of cl-markup is a string whose contents bear a remarkable resemblance to a serialised s-expr; the "parser" uses read-from-string to transform that ...
by JamesF
Thu Feb 10, 2011 10:51 pm
Forum: Common Lisp
Topic: ANN: mark-and-render
Replies: 4
Views: 1451

Re: ANN: mark-and-render

I could look into a Mediawiki importer, if that would be of use, and/or try writing a parser for that style of markup. However... I'm a bit restricted in just what I can do with respect to an actual wiki, as I'm employed by a company that makes, sells and supports one - the potential conflict of int...