Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Lisp Questions

Name: Anonymous 2011-11-18 19:59

So I have some questions about lisp. I've been learning programming but I hear some conflicting information so I need some things cleared up.

First of all, I keep hearing that the ability to wrote code others can read is huge, but since lisp is incredibly hard to read, wouldn't that make lisp programmers inherently bad programmers?

Also, can someone post some non-trivial lisp code? Every time I see someone post lisp code it's always something very short and trivial. Is it possible to write anything real with lisp?

Name: Anonymous 2011-11-19 23:54

Am I doing it right? Cuz retards say that switching on event type is "anti-pattern" or something.


(define (test-sdl)
  (SDL_Init '(SDL_INIT_VIDEO SDL_INIT_TIMER))
  (SDL_Resize 640 480)
  (let ([done #f])
    (till done
      (block event-loop
        (while #t
          (let ([e (SDL_GetEvent)])
            (cond [(false? e) (event-loop #f)]
                  [(SDL_ResizeEvent? e) (SDL_Resize (SDL_ResizeEvent-w e)
                                                    (SDL_ResizeEvent-h e))]
                  [(SDL_QuitEvent? e) (set! done #t)]
                  [(SDL_KeyboardEvent? e)
                   (say "kb $(if (eq? (SDL_KeyboardEvent-state e) SDL_RELEASED) 'released 'pressed)")]
                  [(SDL_MouseButtonEvent? e) (say "mice-button")]
                  ;;[(SDL_MouseMotionEvent? e) (say "mice-motion")]
                  ))))
      #| access SDL_Surface-pixels here |#
      (SDL_Flip SDL_Screen)
      )
    (SDL_Quit)
    ))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List