From a5f7f540122965a361b6ac91388fe382d6358ee0 Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Mon, 29 Jun 2009 21:19:40 +0200 Subject: [PATCH] added DSC example and function default arg eval example. Signed-off-by: AJ Rossini --- TODO.lisp | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/TODO.lisp b/TODO.lisp index b1ec27e..92995a6 100644 --- a/TODO.lisp +++ b/TODO.lisp @@ -1,6 +1,6 @@ ;;; -*- mode: lisp -*- -;;; Time-stamp: <2009-06-24 17:30:03 tony> +;;; Time-stamp: <2009-06-29 21:19:00 tony> ;;; Creation: <2008-09-08 08:06:30 tony> ;;; File: TODO.lisp ;;; Author: AJ Rossini @@ -197,7 +197,7 @@ ;; or netbook size, picture is similar but on a lower-res display window. (defparameter *frame2* (as-frame (create-xlib-image-context 200 200) - :background-color +white+)) + :background-color +white+)) (plot-function *frame1* #'exp (interval-of 0 2) @@ -235,7 +235,38 @@ ) +;;; EXAMPLE FOR DSC2009 + (defparameter *frame2* (as-frame (create-xlib-image-context 200 200) + :background-color +white+)) + (bind ((#2A((f1 f2) (f3 f4)) + (split-frame *frame2* (percent 50) (percent 50)))) + (defparameter *f1* f1) + (defparameter *f2* f2) + (defparameter *f3* f3) + (defparameter *f4* f4)) + (plot-function *f1* #'sin (interval-of 0 2) :x-title "x" :y-title "sin(x)") + (plot-function *f2* #'cos (interval-of 0 2) :x-title "x" :y-title "cos(x)") + (plot-function *f3* #'tan (interval-of 0 2) :x-title "x" :y-title "tan(x)") + (let* ((n 500) + (xs (num-sequence :from 0 :to 10 :length n)) + (ys (map 'vector #'(lambda (x) (+ x 8 (random 4.0))) xs)) + (weights (replicate #'(lambda () (1+ (random 10))) n 'fixnum)) + (da (plot-simple *f4* (interval-of 0 10) (interval-of 10 20) + :x-title "x" :y-title "y"))) + (draw-symbols da xs ys :weights weights)) + (xlib-image-context-to-png (context *f1*) "/home/tony/test1.png") + (xlib-image-context-to-png (context *frame2*) "/home/tony/test2.png") + + + ;; back to normal application (in-package :ls-user) +(defun testme (&key (a 3) (b (+ a 3))) + b) + +(testme) +(testme :a 2) +(testme :b 4) +(testme :a 2 :b (* a 5)) -- 2.11.4.GIT