Paste number 49741: my-program-size

Index of paste annotations: 1 | 2 | 3 | 4 | 5

Paste number 49741: my-program-size
Pasted by: fax
11 months, 2 weeks ago
#lispcafe | Context in IRC logs
Paste contents:
Raw Source | XML | Display As
CL-USER> (defun my-program-size ()
           (let ((self '(defun my-program-size ()
                         (let ((self))
                           (write (list 'my 'length 'is (1+ (* 2 (program-size self)))))
)
)
)
)

             (write (list 'my 'length 'is (1+ (* 2 (program-size self)))))
)
)

MY-PROGRAM-SIZE
CL-USER> (my-program-size)
(MY LENGTH IS 37)
CL-USER> (program-size '(defun my-program-size ()
                         (let ((self '(defun my-program-size ()
                                       (let ((self))
                                         (write (list 'my 'length 'is (1+ (* 2 (program-size self)))))
)
)
)
)

                           (write (list 'my 'length 'is (1+ (* 2 (program-size self)))))
)
)
)

37

Annotations for this paste:

Annotation number 1: lambda program-size
Pasted by: fax
11 months, 2 weeks ago
Context in IRC logs
Paste contents:
Raw Source | Display As
CL-USER> ((lambda (size) (write (list 'my 'program 'size 'is size)))
          (program-size '(lambda (size) (write (list 'my 'program 'size 'is size))))
)

(MY PROGRAM SIZE IS 13)

Annotation number 2: my size is?
Pasted by: fax
11 months, 2 weeks ago
Context in IRC logs
Paste contents:
Raw Source | Display As
CL-USER> ((lambda (size) (format t "My program size is ~a" size))
          (+ 6 (* 2 (program-size '(lambda (size) (format t "My program size is ~a" size)))))
)

My program size is 18
NIL
CL-USER> (program-size +)
18

Annotation number 3: write program size
Pasted by: fax
11 months, 2 weeks ago
Context in IRC logs
Paste contents:
Raw Source | Display As
CL-USER> (write '(my program size is 7))
(MY PROGRAM SIZE IS 7)
CL-USER> (program-size +)
7

Annotation number 4: 1
Pasted by: fax
11 months, 2 weeks ago
Context in IRC logs
Paste contents:
Raw Source | Display As
CL-USER> 1
1
CL-USER> (program-size +)
1

Annotation number 5: eval
Pasted by: fax
11 months, 2 weeks ago
Context in IRC logs
Paste contents:
Raw Source | Display As
CL-USER> (let ((program '(write (list 'my 'program 'size 'is x))))
           (eval (list 'let (list (list 'x (+ 16 (program-size program)))) program))
)

(MY PROGRAM SIZE IS 27)
CL-USER> (program-size +)
27

Colorize as:
Show Line Numbers
Index of paste annotations: 1 | 2 | 3 | 4 | 5

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.