Search found 133 matches

by sylwester
Wed Apr 12, 2017 5:44 pm
Forum: Homework
Topic: Constant terms in macro parameters...
Replies: 2
Views: 17816

Re: Constant terms in macro parameters...

Code: Select all

(defmacro defrule (name &rest rest)
  ...)
Now name will be "name of the rule" and rest will be (:when (s-expression 1) ... :perform (s-expresion 1) ...)
Your macro can iterate and collect and do all sorts of things and you look for :when and :perform to switch mode.
by sylwester
Thu Mar 23, 2017 7:05 am
Forum: Homework
Topic: Exercise from Grahams "Ansi Common Lisp"
Replies: 3
Views: 17169

Re: Exercise from Grahams "Ansi Common Lisp"

The reason fo that is because you have no stop condition for when the function has failed to find a sublist. the final tail of a proper list is nil and (car nil) is nil. nil is a list. The logic must check if the list is the empty list and return nil. if it is not then you can do the rest your funct...
by sylwester
Mon Feb 27, 2017 4:17 pm
Forum: Common Lisp
Topic: Reference a variable
Replies: 3
Views: 10802

Re: Reference a variable

Even though it can be done I assume you are doing it wrong if you need it.
If you need a hash table why not use a hash table? It can even take arbitrary types as keys if :test is equal.
by sylwester
Fri Jan 27, 2017 6:06 pm
Forum: The Lounge
Topic: How to start learning Lisp
Replies: 3
Views: 20462

Re: How to start learning Lisp

Learning how to program is pretty much the same a learning to bake. You start with some good books or tutorials that hows you show you examples giving you an idea how to interpret recipes and how stuff works, which you can experiment by mixing and matching. Then you perhaps know how to make your own...
by sylwester
Sun Dec 25, 2016 2:28 pm
Forum: The Lounge
Topic: Learning Lisp
Replies: 1
Views: 14035

Re: Learning Lisp

Learning by doing. Pick up a book if you have no idea where to start, but be sure to make subtle changes in the examples and try out stuff since that is how you learn. Common Lisp resources: Land of Lisp (I love this one, but it's not free) Practical Common Lisp (Love this one too, use the loop chap...
by sylwester
Thu Oct 27, 2016 3:45 am
Forum: The Lounge
Topic: PROLOG FORUM?
Replies: 6
Views: 26794

Re: PROLOG FORUM?

Since the original posts were also in October I didn't get the thread was resurrected :-(
by sylwester
Tue Oct 25, 2016 6:22 am
Forum: Scheme
Topic: how do I run this procedure?
Replies: 1
Views: 14968

Re: how do I run this procedure?

Your procedure returns a new procedure. In Scheme you have this way of making a variable: (define test 10) (define test-proc (lambda (n) (+ n n)) Then you have this abbrivation for the special case where the value is a procedure: (define (test-proc n) (+ n n)) It's the same as the other expression m...
by sylwester
Fri Oct 07, 2016 6:35 pm
Forum: The Lounge
Topic: PROLOG FORUM?
Replies: 6
Views: 26794

Re: PROLOG FORUM?

Of course in 2 days you can learn the rules. It's possible to teach someone chess in 30 minutes so I guess you can learn prolog in 2 days, limited to "primitives, means of combination, and means of abstraction". As with the new chess player won't be a good chess player you wont be that goo...
by sylwester
Thu Sep 22, 2016 4:51 pm
Forum: The Lounge
Topic: LISP Machine Virtual Machine?
Replies: 2
Views: 17048

Re: LISP Machine Virtual Machine?

Symbolics had alot of influence on Common Lisp. eg. how error handling works. Probably the last versions were compatible with Common Lisp so the language flavor probably wasn't the big thing with symbolics, but the way they made computers specifically to run lisp was quite interesting. The CPU of th...
by sylwester
Sat Sep 17, 2016 6:45 pm
Forum: The Lounge
Topic: Hello from Spain
Replies: 3
Views: 18113

Re: Hello from Spain

Hola / Hei I actually started learning the very first version of Lisp, based on an essay by Paul Graham called The roots of Lisp . I then started with Common Lisp using the book The land of lisp . I then went trough the SICP videos . After than I read the first lambda papers and then the R5RS report...