deleted-page Moved to sand-box
;; Not a comment I like it RAW!!!
I just added this
| Is this a table | A | B | C |
| And | this | works | too? |
this emphasis and this more
And you can have normal text as well, right?
Have fun with Scheme pre-formatting :
; lisp-01-animals.scm (define (wag-tail ) (display "I am wagging my tail\n")) (define (bark) (display "I am barking\n")) (define (scurry) (display "I am scurrying\n")) (define (squeak) (display "I am squeaking\n")) (define (rub-legs) (display "I am rubbing your legs\n"))(define (scratch-carpet) (display "I am scratching the carpet\n")) (define (behave animal) ((cdr (assoc 'behaviour animal)))) (define dog `((behaviour . ,(lambda () (wag-tail) (bark))))) (define cat `((behaviour . ,(lambda () (rub-legs) (scratch-carpet))))) (define rabbit `((behaviour . ,(lambda () (squeak) (scratch-carpet))))) (behave dog) (behave cat) (behave rabbit) ; consider using make-object-property and set! instead of this association ; list ; the right syntax to execute the functions is exactly as Common Lisp ; guile> ((lambda () (wag-tail) (bark))) ; I am wagging my tail ; I am barking ; the following quote from #scheme on FreeNode is a great explanation of why ; this works http://tunes.org/~nef/logs/scheme/05.01.07 ; ; <Catfive> dcorking - the key here is something called quasiquotation. ` (the backtick) is shorthand for (quasiquote ...) which is a quoted expression that allows you to escape out of it using the forms , (unquote) and ,@ (unquote-splicing). ; <Catfive> sarahbot, eval '(a b c) ; <sarahbot> (a b c) ; <Catfive> sarahbot, eval `(a b c) ; <sarahbot> (a b c) ; <Catfive> sarahbot, eval `(a ,(+ 1 1) c) ; <sarahbot> (a 2 c) ; <dcorking> aha - so that means that lambda is evaluate at dogs 'define time' but the property name 'beahviour is quoted ans so not evaluated ; <dcorking> eek my typing :( but quasiquote - your demo explanation and bug fix are all very cool
testing
This is the sandbox please don't just let this page sit here. Modify as you like!