Paste number 332457: yasb

Paste number 332457: yasb
Pasted by: adeht
When:2 years, 6 months ago
Share:Tweet this! | http://paste.lisp.org/+74IX
Channel:None
Paste contents:
Raw Source | XML | Display As
CL-USER> (defconstant meaning-of-universe 41)
MEANING-OF-UNIVERSE
CL-USER> (defclass encapsulated ()
           ((thing :initarg :thing :reader thing)))
#<STANDARD-CLASS COMMON-LISP-USER::ENCAPSULATED>
CL-USER> (defun encapsulate ()
           (make-instance 'encapsulated
                          :thing meaning-of-universe))
ENCAPSULATE
CL-USER> (thing (encapsulate))
41
CL-USER> (defconstant meaning-of-universe 42)
MEANING-OF-UNIVERSE
CL-USER> meaning-of-universe
42
CL-USER> (defun encapsulate ()
           (make-instance 'encapsulated
                          :thing meaning-of-universe))
WARNING: redefining COMMON-LISP-USER::ENCAPSULATE in DEFUN
ENCAPSULATE
CL-USER> (thing (encapsulate))
41
CL-USER> (lisp-implementation-version)
"1.3.11"
CL-USER> 

This paste has no annotations.

Colorize as:
Show Line Numbers

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