Search found 20 matches

by adam33147
Sun Sep 18, 2011 6:38 am
Forum: Common Lisp
Topic: List building
Replies: 5
Views: 3912

Re: List building

A small modification to function in "ANSI Common Lisp".

Code: Select all

(defun filter (lst &optional (fn #'identity))
	   (let ((acc nil))
	     (dolist (x lst)
	       (let ((val (funcall fn x)))
		 (if val (push val acc))))
	     (nreverse acc)))
by adam33147
Mon Sep 12, 2011 3:51 pm
Forum: The Lounge
Topic: Lisp as assembly language??
Replies: 12
Views: 33475

Re: Lisp as assembly language??

I find this a fascinating subject. But there seem to be so many dead ends. Here is a page I found some time back with Lisp OSes. There are many dead projects mixed in if I remeber correctly. http://linuxfinances.info/info/lisposes.html This one seems very interesting. http://common-lisp.net/project/...
by adam33147
Sun Sep 11, 2011 8:27 am
Forum: Common Lisp
Topic: Mergesort-divide list to lists of two argument
Replies: 3
Views: 3378

Re: Mergesort-divide list to lists of two argument

You dont need the embedded defun dividetwo-iter. I looks like you are trying to have a local funtion via the embedded defun. This would be accomplished with the labels form. (defun name (x) (labels ((fun-name (var-a var-b) (+ a b))) (fun-name x 10)) The way you have it would end up redefining the gl...
by adam33147
Wed Sep 07, 2011 12:15 pm
Forum: The Lounge
Topic: Whats your view of Lisp in the large picture?
Replies: 1
Views: 4374

Whats your view of Lisp in the large picture?

I have programmed in Turbo Pascal, Basic, Visual Basic, Java, C, and Common Lisp (not that I got good at any of them). I would say that Lisp blows them all away in terms of thinking about a program through the tools of a progamming language. Its funny that when I talk to programmers trained on more ...
by adam33147
Tue Sep 06, 2011 3:47 pm
Forum: Common Lisp
Topic: please help me understand this lisp function
Replies: 7
Views: 4744

Re: please help me understand this lisp function

If you used only the defined structure interface functions, that would be correct. In the insert function group, there is a function called BST-leaf-insert. If you use the convention (make-bin-tree-node reference-element left-tree right-tree), Notice that the reference element in the node created is...
by adam33147
Sun Sep 04, 2011 6:40 pm
Forum: Emacs
Topic: [SOLVED] Emacs and CLISP/SLIME are missing ASDF
Replies: 3
Views: 12278

Re: Emacs and CLISP/SLIME are missing ASDF

I remember I had a problem with this once. I tried editing the file, but then another error popped up, then another (either another package not found or another file didnt find the ASDF package, dont remeber.). I didnt chase it down too far though. You can try installing slime from the website, or f...
by adam33147
Sun Sep 04, 2011 1:01 pm
Forum: Common Lisp
Topic: please help me understand this lisp function
Replies: 7
Views: 4744

Re: please help me understand this lisp function

I seems the function BST-node-remove returns the right node in that case.

E is removed because it is excluded from the reconstructed tree.
by adam33147
Sun Sep 04, 2011 10:21 am
Forum: Common Lisp
Topic: Mapping a different syntax to Lisp
Replies: 10
Views: 7501

Re: Mapping a different syntax to Lisp

This is turning out to be alot tougher then I thought. I want to make the syntax better. I have the concepts, but implemeting them is really hard. For example, the following defun plus (a,b) {a + b} defun minus (a,b) {a - b} Could be implemented if the {} are interpreted to mean a list with the open...
by adam33147
Sat Sep 03, 2011 2:05 pm
Forum: Common Lisp
Topic: Mapping a different syntax to Lisp
Replies: 10
Views: 7501

Re: Mapping a different syntax to Lisp

Thank you for the feedback. Sweet-expressions looks really interesting. I think that after implementing this, I can give that a serious look. (after all, one of the reasons I like lisp is that I like to learn first hand by implenting things). The way their expressions look are so much better then wh...
by adam33147
Thu Sep 01, 2011 5:44 pm
Forum: Common Lisp
Topic: please help me understand this lisp function
Replies: 7
Views: 4744

Re: please help me understand this lisp function

To help understand what #'BST-node-remove is doing, try to see the following patterns. *Since the tree is sorted, the program determines to search either the (<= remove-this node-referece) sub-tree, or the (> remove-this node-reference) sub-tree. *If when checking the left tree, the right-tree is re...