patrickwonders

TC Lispers April Presentations online

The Twin Cities Lisp Users Group meeting for April was last Monday. The main topic was Web Frameworks, but there were also two shorter talks.

Weblocks Presentation

Patrick Stein gave this presentation at the TC Lispers meeting in April 2010.

Weblocks on Vimeo.

Allegro Serve and Web Actions Presentation

Robert Goldman gave this presentation at the TC Lispers meeting in April 2010.

Apology: Unfortunately, ScreenFlow bombed out on me when I went to stop recording. It subsequently saw that it had a partial project there but was unable to recover it. As such, there is no video available for this presentation. Feh. — Patrick

Hunchentoot Presentation

Paul Krueger gave this presentation at the TC Lispers meeting in April 2010.

Hunchentoot on Vimeo.

Cocoa Lisp Controller Presentation

Paul Krueger gave this presentation at the TC Lispers meeting in April 2010.

Cocoa Lisp Controller on Vimeo.

CL-Growl Presentation

Patrick Stein gave this presentation at the TC Lispers meeting in April 2010.

CL-Growl on Vimeo.

  • Current Mood
    pleased pleased
Nana Hangin' Around
  • veeman8

COND system with Define.

Hey LISPers. I'm using Scheme. Please don't kill me.

I have a question that I can't seem to answer. Here's the code:

(define final '())

(cond (
(< frst scnd)
(define final (cons final frst))
(define final (cons final scnd))

)

This is what it's supposed to mean:
First, final is defined to null.
We have a condition statement. It states....

If first is less than second, define final by concatenating the variable first to the end of final
then, define final by concatenating the variable second to the end of final.

Of course, it gives me the following error:

define: not allowed in an expression context in: (define final (cons final first))

Any idea why, and how to fix it? :\

Thanks.
  • Current Location
    angry
patrickwonders

Lisp Troubles: Fabricating a Closure...

The short version of my problem is that I want to do this:

(defun generate-setter (buffer pre post)
  (eval `(lambda (index value)
	   (setf (aref buffer ,@pre index ,@post) value))))

Except that I want the (lambda ...) to be a closure around buffer. Here, pre and post are lists generated at runtime (thus not available as lists at compile time) and hence the (defun ...) and (eval ...) instead of (defmacro ...). Alas, the (eval ...) form uses the null lexical environment, so I cannot capture buffer.

The long form with some of the myriad failed attempts I have made is on this blog post. Please, anyone have half a cup of clue that I could borrow? I promise, I'm going to the store for more clues really soon. I'll pay you back.

Edit: Here is exactly what I was looking for... (courtesy of tfb)

(defun generate-setter (buffer pre post)
  (let ((make-closure
           (compile nil `(lambda (buf)
                           (lambda (index value)
                             (setf (aref buf ,@pre index ,@post) value))))))
    (compile nil (funcall make-closure buffer))))
ferrets

Scheme definition fork

I'm surprised that there's been no comment on the double Scheme announcement from the steering committee.

We believe the diversity of constituencies justifies the design of two separate but compatible languages, which we will (for now) call "small" and "large" Scheme.

Small Scheme

* Constituencies: educators, casual implementors, researchers, embedded languages, "50-page" purists
* Think "IEEE/R5RS brought up to the current date."
* ~ 90% supermajority to be required for final ratification

Large Scheme

* Constituencies: programmers, implementors
* Think "R6RS with a happier outcome."
* ~ 75% supermajority to be required for final ratification


I suggest that "small" and "large" Scheme be named after Sussman (who co-wrote SICP) and Steele (who co-authored the Common Lisp standard) respectively. :-)

(Cross-posted to lisp and schemers)
  • esgab26

Can any one help?-About the "cond" operator ----(novice)

Hi everyone,

I've read this in SICP book from MIT-OCW:

"A minor difference between if and cond is that the <e> part of each cond clause may be a sequence of expressions. If the corresponding <p> is found to be true, the expressions <e> are evaluated in sequence and the value of the final expression in the sequence is returned as the value of the cond. In an if expression, however, the <consequent> and <alternative> must be single expressions. "

so i tried this in scheme:

(define (test a b)
    (cond ((> a b) ((- a 1) (- b 1)))
               ((< a b) ((+ a 1) (+ b 1)))
               (else((+ a b) (- a b)))))

(test 3 2)

it returned: procedure application: expected procedure, given: 2; arguments were: 0

What I'm trying to do is: given a single predicate, evaluate multiple expressions (like the ones above, evaluate both (- a 1) and (- b 1)

i thought this is possible: (because of what i've read- or maybe i just don't understand it)

(cond <predicate> (<exp1> <exp2> <exp3>))- but it always result in an error

Can some one help me with this? What is meant by sequence of expressions?

Thank you very much

Eljon

  • Current Mood
    confused confused
ferrets

(Novice) How to do nothing in Scheme?

I'm teaching myself some Scheme using PLT Scheme and have been using it to write some scripts. Because Scheme isn't purely functional, I ran into a situation where I wanted the option of doing "nothing". In my mind, it looked something like this:
(if (eof-object? x)
  (do-nothing)
  (display message) )

PLT Scheme requires that (if ...) must have an else clause, which seems to be non-standard.

In my working version, (do-nothing) is replaced by (display ""). (begin) is illegal. '() gets displayed on screen, which I don't want.

Am I not thinking Lispily (or Schemingly) enough, or is there some way to tell PLT Scheme to do nothing and to move along?



P.S. Oh no—another learning experience! :-) Thanks, everyone.
  • jkndrkn

Lisp in Production Systems

Hello Friends

My road to Lisp started with a personal desire to learn Lisp due to its historical significance and recent renewed interest. The quality and clarity of Practical Common Lisp and the writings of Paul Graham were strongly motivating factors. I learned Lisp and began using it to solve problems in graduate level courses where the choice of implementation language was left to students, and was eventually motivated to use Lisp in its traditional role by taking a number of AI courses.

I have a fairly solid understanding of the language and how to solve problems using it. However, my projects are relatively small and self-contained and do not interact with the outside world. I would like to develop some experience interfacing with the web and producing code that follows conventions frequently seen in modern Lisp production environments.

What is the best way to go about learning the particulars of production-ready Lisp? It seems that the common route is to create some kind of web application and ensure that it follows conventions that make it easy for other experienced Lisp programmers to extend and redeploy. I've also long held a desire to program a super nerdy customization-heavy turn based combat strategy game. Are there any solid and portable free graphics packages that work well with Lisp?

How have you been introduced to Lisp in production systems?