Search found 117 matches

by Warren Wilkinson
Sun Feb 20, 2011 6:43 pm
Forum: Common Lisp
Topic: Numerical Integration
Replies: 6
Views: 3560

Re: Numerical Integration

You say integration -- but your integration function seems to be simply a stepping from one state to the next.

Do you mean integration as in the inverse of a derivative?
by Warren Wilkinson
Tue Feb 15, 2011 2:47 pm
Forum: Scheme
Topic: Some Idea
Replies: 8
Views: 17407

Re: Some Idea

Yep, your right -- you've identified a problem with your implementation. Your IF statement says "If the first element of the list is NOT zero -- then the count is zero". What you probably meant to say is "If the first element of the list is NOT zero, then the count is the count-of-zeros in the rest ...
by Warren Wilkinson
Sat Feb 12, 2011 5:41 pm
Forum: Scheme
Topic: Some Idea
Replies: 8
Views: 17407

Re: Some Idea

In common lisp: (count 0 list) If this is a homework assignment (and you're expected to implement count yourself) think of the problem recursively. The number of zeros in a list is: the number of zeros in the rest of the list plus 1 (if this item is a zero) or 0 (if this item is not zero). Also, the...
by Warren Wilkinson
Sat Feb 12, 2011 2:52 am
Forum: Common Lisp
Topic: Literal Lists
Replies: 19
Views: 10054

Re: Literal Lists

I would think a literal list being modified would be defined as 'the literal list gets modified' =).

Must be something to do with the ,. operator... how does the ,@ operator fare?
by Warren Wilkinson
Sat Feb 12, 2011 2:40 am
Forum: Common Lisp
Topic: ANN: mark-and-render
Replies: 4
Views: 2611

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). A little web-app that could take one wiki's syntax and translate it into anothers might be an interesting project. A bit academic maybe, but it might save somebodies bacon a c...
by Warren Wilkinson
Sat Jan 29, 2011 1:31 pm
Forum: Common Lisp
Topic: Newbie questions - and yes, its homework :-(
Replies: 21
Views: 10159

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

Hey good work FKeel, I was going to mention using functions like 'null' and 'zerop', but you seem to have found them yourself. I was looking at this: (defun largest-smallest (lst &optional (small (car lst)) (large (car lst))) (cond ((null lst) (+ small large)) ((< (car lst) small) (largest-smallest ...
by Warren Wilkinson
Fri Jan 28, 2011 2:23 pm
Forum: Common Lisp
Topic: Newbie questions - and yes, its homework :-(
Replies: 21
Views: 10159

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

I'm going to give you a tutorial on recursion. Consider factorials . 5! (five factorial) is defined as 5 * 4 * 3 * 2 * 1. Here are more examples: 0! = 1 1! = 1 2! = 2 * 1 3! = 3 * 2 * 1 4! = 4 * 3 * 2 * 1 5! = 5 * 4 * 3 * 2 * 1 Or, put another way: 1! = 1 * 0! 2! = 2 * 1! 3! = 3 * 2! 4! = 4 * 3! 5! ...
by Warren Wilkinson
Mon Jan 24, 2011 1:55 pm
Forum: Common Lisp
Topic: How to detect a special variable
Replies: 6
Views: 3236

Re: How to detect a special variable

Would something like this work?

Code: Select all

(defvar *debug-store* nil)
(defmacro debug-store (value) `(setf *debug-store* ,value))
by Warren Wilkinson
Tue Jan 18, 2011 6:21 pm
Forum: Common Lisp
Topic: Date operation
Replies: 4
Views: 2500

Re: Date operation

In this case he is using a library of time & date routines that store time in a specialized structure (basically just two unsigned 32's).

Read Eric Naggum's The Long, Painful History of Time for the 'why' of it.
by Warren Wilkinson
Mon Jan 17, 2011 11:02 am
Forum: Common Lisp
Topic: Binary Stream and Binary Types
Replies: 11
Views: 6632

Re: Binary Stream and Binary Types

I've used a lot of languages, and I don't recall any of them having a sane standard way of dealing with binary data. If you point me towards some of them, I might be able to find useful CL libraries that work like that. Edi Weitz tends to have a useful library for everything. Actually, just looking ...