Search found 98 matches

by JamesF
Thu Feb 10, 2011 5:32 pm
Forum: Common Lisp
Topic: ANN: mark-and-render
Replies: 4
Views: 1437

ANN: mark-and-render

Yes, it's yet another markup package for HTML. Because that's what the world needs most right now. What I needed (OK, wanted) was an engine that would render HTML from wikimarkup. The back-story's a bit involved, but I started with s-expressions, found them unwieldy, realised I was nicely placed to ...
by JamesF
Wed Feb 09, 2011 6:22 pm
Forum: Common Lisp
Topic: putting it together
Replies: 5
Views: 2176

Re: putting it together

Hi Yuiop, Where you're using setq, you should be using either defvar or defparameter. They both declare a special variable (like a global variable, basically), and in this case that's all you want. setq (or setf, more commonly) is for updating the variable's value afterwards, and you're not doing th...
by JamesF
Thu Jan 27, 2011 4:25 pm
Forum: Common Lisp
Topic: Newbie questions - and yes, its homework :-(
Replies: 21
Views: 5389

Re: Newbie questions - and yes, its homework :-(

Maybe someone here can give me some pointers on how to think of them ---------------------- (1) Write a recursiveLISP function add‐to‐odd which takes a list of numbers as its argument and returns the same list, but with 1 added to each of the odd numbers. So: > (add‐to‐odd '(3 6 7 4 6 5)) (...
by JamesF
Sun Jan 16, 2011 3:59 pm
Forum: Common Lisp
Topic: Destructive function on constant data
Replies: 7
Views: 2351

Re: Destructive function on constant data

Can anyone tell me what I'm doing wrong here: (let* ((x '(1 2 3 4 5)) (y)) (setf y (nreverse x))) This smells like C-style thinking. Why not this? (let* ((x '(1 2 3 4 5)) (y (reverse x))) You'd actually need let* in this case, whereas let is sufficient in your original snippet, where it doesn't mat...
by JamesF
Tue Jan 11, 2011 7:15 pm
Forum: Common Lisp
Topic: Binary Stream and Binary Types
Replies: 11
Views: 3961

Re: Binary Stream and Binary Types

Dude, if you think that's painful, wait 'til you look at the generalised machinery for handling filepaths. It was standardised at a time when there were Unix, DOS, VMS with its built-in file-versioning, other exotic systems floating about, and more being developed. Try handling that in a portable wa...
by JamesF
Mon Dec 06, 2010 3:07 pm
Forum: Common Lisp
Topic: what is cd in (cd *db*)?
Replies: 4
Views: 1142

Re: what is cd in (cd *db*)?

Hint: that's not the only place you see that symbol. Look at how it's used elsewhere in the function, and it should start to make sense.
The documentation should also help.
by JamesF
Wed Oct 27, 2010 6:50 pm
Forum: Common Lisp
Topic: SAT solver
Replies: 3
Views: 1119

Re: SAT solver

You say you "have to do" this. Is it for a course you're studying? If so, I'd recommend going through your course notes and textbook, and possibly asking your teacher or tutor for some pointers. The place to start would be understanding the problem: look at what it is that you have to do - what inpu...
by JamesF
Mon Oct 25, 2010 11:25 pm
Forum: Common Lisp
Topic: Editing a Stream Question
Replies: 5
Views: 1343

Re: Editing a Stream Question

how about moving the original file to /tmp..? Because if you have a power failure or generally something triggering system restart inside that operation, /tmp filesystem might get wiped after the original is moved but before new version was completely written leading to data loss. I did say I hadn'...
by JamesF
Mon Oct 25, 2010 5:23 pm
Forum: Common Lisp
Topic: Editing a Stream Question
Replies: 5
Views: 1343

Re: Editing a Stream Question

You might want to check the Hyperspec's entry on 'open - I think supersede will do what you want, better than overwrite - you'll have to assume the prefixed colons on those keywords, because BBCode thinks overwrite starts with a horrified expression. Also, Nuntius has an excellent idea, though I'll ...
by JamesF
Sun Oct 17, 2010 11:13 pm
Forum: Common Lisp
Topic: FAQ
Replies: 4
Views: 31023

Re: FAQ

VIlisp is useful for working with Vim, if your idea of an IDE is an editor plus a terminal in which the REPL is running, and way of funnelling stuff from one to the other (that'd be me). There are other options for working with Vim, such as Limp and Nekthuth, but I've personally found nothing that ...