libera/#commonlisp - IRC Chatlog
Search
4:39:49
hayley
So, The Art of the Metaobject Protocol turns 30...today or perhaps yesterday depending on time zone.
8:36:42
lisp123_
Can I redefine standard functions within this package and they will shadow the standard ones (but where I don't specify them, they will fall back to the standard ones)?
8:39:45
lisp123_
I am getting an error "Lock on package COmmon-Lisp violated) - is there a way to suppress this?
8:45:59
pjb
(defpackage "YOUR-CL" (:use "CL") (:export . #.(let (clsyms) (do-external-symbols (s "CL" clsyms) (push (string s) clsyms)))) (:shadow "DEFUN"))
8:47:14
pjb
(in-package "YOUR-CL") (defmacro defun (name lambda-list &body body) `(CL:defun ,name (,@lambda-list &aux (,(gensym) (print '(entering ,name)))) ,@body))
8:47:40
pjb
mind using the qualified name when you want to refer to the CL symbol, instead of yours.
9:02:05
kakuhen
I am thinking of something like (let ((etc (make-instance 'standard-class))) ...) and using 'etc as a type
9:13:07
kakuhen
yeah this is good -- just now I found a solution involving ccl:ensure-class, but it is not portable enough
9:34:09
kakuhen
something that compiles fine literally everywhere else is fine but sbcl must spam nearly 1,000 lines at my repl with a dozen style warnings
9:38:03
pjb
kakuhen: c2mop is a portability layer for the MOP, allowing you to use it the same way on all implementations providing some level of MOP.
9:40:03
pjb
The CL (CLOS) standard doesn't impose much introspection/retrospection; just a minimum. This allows to write batch compilers and perform a lot of compilation-time optimizations. The MOP goes 100% Smalltalk: you can redefine everything.
10:44:38
pjb
It's completely natural that we have CLOS and the MOP, given that Smalltalk was implemented in lisp originally.
13:28:08
hayley
As the nicks have no letters in common, I bet they thought they could get away with it.
14:50:43
pjb
"The first version, termed Smalltalk-71, was created by Kay in a few mornings on a bet that a programming language based on the idea of message passing inspired by Simula could be implemented in "a page of code"."
14:59:19
pjb
Well, it's not clear from the linked EarlyHistoryST document if he wrote it in lisp or just was inspired by lisp implementation to write a smalltalk implementation in a similar way.
14:59:42
pjb
It's possible the Smalltalk lisp sources I've seen were later implementation in lisp of Smalltalk, on other systems.
15:02:26
pjb
It's funny that in 70s he worked a lot on the syntax, instead of concentrating on the fundamental mechanism such as message sending and receiving.
15:02:48
pjb
A lisper would just implement that; the syntax if sexp didn't suffice, would come later, as way of reader macros…
15:18:55
pjb
Ah yes, Dan Ingalls implemented the first Smalltalk-71 design in BASIC on the NOVA. Hey! Basic wasn't that useless after all :-)
15:37:13
Josh_2
https://docs.google.com/spreadsheets/d/14MFvpFaJ49XIA8K1coFLvsnIkpEQBbkOZbtTYujvatA/edit#gid=191987842 interesting
16:08:23
beach
lisp123_: Use CADR if you have a structure of CONS cells. Use SECOND if you have a list of elements.
16:23:29
lisp123_
I transforming the code now, but I wonder if its something that should be done at a more professional level