libera/#commonlisp - IRC Chatlog
Search
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
16:23:49
lisp123_
since it will allow paradigms of logic programming, nondeterministic computing etc, in a standard way
16:23:57
beach
It's a very naive approach, meant for pedagogical purposes. You won't get any performance out of it.
16:25:24
lisp123_
Yup its on my list, but I have to get through SICP first and then Design & Analysis of Computer Programming which you recommended and I finally got in the mail
16:26:31
beach
You need to compile to native code and do all the traditional compiler optimizations (and then some) to get decent performance.
16:29:33
beach
lisp123_: I am off to spend the rest of the day with my (admittedly small) family. I hope you can get answers from others in case you have more questions.
16:45:33
nirnam
or something in the sense of linux/posix programmer manual that can pull it out with man page
16:51:58
jcowan
WSCL has the final draft ANS in it, which is not as handy as the CLHS, but is public domain
16:54:39
nirnam
have anyone created gnu info version of hyper spec? I suppose could be as light weight and easier to access
16:58:03
nirnam
I just want cl document/manual that is complete and easy to access without an pdf read or browser
16:58:23
jcowan
Note that CLHS isn't just the ANS, it has a lot of stuff that kmp added, nottably the issues
16:58:42
lisp123_
I mean its mostly well accessible, the only benefit they get is a bit of branding - if its a large FAANG I wouldn't feel bad of 'freeing' it, but don't want to cause any issues to a small company trying to make aliving in lisp :D
16:59:07
lisp123_
nirnam: assuming you use Emacs, http://snowsyn.net/2020/01/01/local-clhs-access-in-emacs/
16:59:40
jcowan
Since anyone can copy the CLHS freely (just not modify it), LispWorks is obviously not making money on it.
16:59:44
nirnam
this here is a vim users, I don't want to say it becase I get weird look by other lisper
17:00:22
jcowan
This here is an 'ex' user (not an ex-user) who drops into vi mode to check paren mattching by bouncing on the % key.
17:00:44
lotuseater
and if i now dump parts to pandoc for creating org files and modify them just for myself and educational purpose, LispWorks will hunt me down?
17:01:52
nirnam
well, we just called out to man/info command to veiw document say in C or Perl, there's no reason to use vim itself to veiw the document since it just an editor
17:03:42
lisp123_
lotuseater: as long as you don't distribute it, I don't think there's any issues, but I am not a lawyer
17:08:11
psycomic
How is the common lisp exception system implemented? Is it built into the lisp system or is it based on lower level primitives and implemented in lisp itself?
17:08:34
nirnam
say if I distribute a script to do exactly that, fetch clhs, parse it to info doc, save it to /usr/share/doc, can I get in trouble with this?
17:09:03
nirnam
technically speaking I didn't distribute modified version of the document, I distribute something that does it
17:10:18
lotuseater
I'm sure LispWorks has an extra department for that, which then comes up with parentheses clubs.
17:11:09
lisp123_
On that topic, I bought a copy of the actual standard and was gonna share it publicly, but then ANSI stamped my name on every page lol
17:13:17
_death
psycomic: check out https://github.com/phoe/portable-condition-system/ there is also a book (which I've yet to read)
17:16:38
psycomic
_death: I'm actually reading it right now, but i don't understand all of it. I'll probably read the book
17:19:35
_death
psycomic: there are also papers related to the condition system on Pitman's site.. http://www.nhplace.com/kent/Papers/index.html
17:20:00
lotuseater
it would take me also to the next step writing serious stuff or application software for others
17:20:43
lotuseater
maybe in August a project comes up, developing a special system for someone who looks for one since 2019