libera/#commonlisp - IRC Chatlog
Search
15:44:03
dieggsy
A while ago I think someone suggested a way to create a graph of class structure/inheritance - does anyone have any ideas? Allegro's composer has a utility for this, but it seems to crash on Emacs for macos (without X11). We have some custom method that user graphviz, but I'm wondering if there's a more straightforward or portable way
15:46:28
beach
As I recall, it's a command that starts with comma, like ,show-class-subclasses and ,show-class-superclasses
16:51:20
beach
That would depend a lot on the implementation of both Common Lisp and that other language.
16:52:14
lucerne
beach: Perl and Python both have one canonical implementation AFAI, and I am open to using any (free) CL, though I prefer SBCL.
17:26:54
Bike
please post descriptions of links you post if their content is not obvious from the url
17:27:06
lucerne
Xach: I currently just want a language (any language) that I can code once in, and use it anywhere. CL is one of the nicest langs I know, so I wanted this main lang to be CL. I guess I’d go with zig now.
17:28:03
Xach
lucerne: the easiest way to do that is to become important enough at a company or other organization that you can dictate technical details.
17:30:25
lucerne
But I do not want to duplicate some basic functionality between CL and Perl and others. I can’t afford that, being just one person 😄
17:30:55
Xach
I've been pretty happy simply ditching perl and using CL for everything, but it is a personal choice.
17:31:16
mfiano
Raku (formerly Perl 6) might be worth looking into, as it has a lot in common with CL, but this is off-topic here.
17:41:22
copec
It feels like there is an exponential explosion of new languages in the last 10 years
17:52:52
pjb
lucerne: you can use libecl.so and dynamically link it into any program, to use Common Lisp.
17:57:37
pjb
lucerne: but if you're afraid of the work, you can still avoid duplication by having two programs, one in perl and one in common lisp, and communicating thru a pipe or sockets.
18:10:55
jcowan
on IRC, it's morning when you join / start talking, and night when you leave / stop talking.
18:46:13
pjb
lisp123: well, I said that :around et al. are better reserved to client code, but actually this has a problem: if the client code adds a :around method on one of your class, this will also be called for other subclasses of yours, in other client libraries.
18:46:36
pjb
lisp123: so even client code may want to refrain adding methods on classes or subclasses that are not its own.
18:47:12
lisp123
pjb: I see. I earlier thought you had meant to use it to avoid changing any interfaces for the client
18:48:01
pjb
What those method do, is to wrap behavior in the right position even for subclasses provided by the client.
18:48:36
pjb
Always keep this picture https://pablofernandez.tech/wp-content/uploads/2011/08/common-lisp-method-composition.png
18:49:04
pjb
or this equivalent one: https://upload.wikimedia.org/wikipedia/commons/4/43/Method-combination.png
18:51:05
lisp123
Fortunately I only code for myself, so I will just stick to standard primary methods :)
19:03:10
pjb
lisp123: notice the cm and mc example (m is a "mixin", and depending on the order it's in the superclasses list, the order of the methods called.
19:04:21
pjb
lisp123: notice also with the cm example, the importance of (when (next-method-p) (call-next-method)) even in the inner primary method (in the superclass).
19:42:07
xaltsc
Hey, is there a "Common Lisp for the Schemer" somewhere ? All the guides/tutorials I've found are either too basic or too advanced...
19:43:56
lisp123
I would think Practical Common Lisp would be perfect for a Schemer because they already understand the basics of Lisp, but not sure if you think its too advanced. If so, ANSI Common Lisp, which is a bit easier to read, might be sutiable
19:45:54
xaltsc
I guess what I want is how to translate scheme idoms to clisp ones, like (define fun (lambda [arg] (...))) is just (defun fun [arg] (...))
19:47:25
lisp123
You can try this cheat sheet if you want something to the point: https://github.com/ashok-khanna/lisp-notes
19:47:43
Alfr
xaltsc, you can't, e.g. tail call optimization isn't mandated and some implementations might exhaust the stack; also no call/cc.
19:48:52
lisp123
xaltsc: Unfortunately (I can get your perspective now), I can't think of anything that would be perfect for you. You might need to just bite the bullet and read through PCL
19:48:54
xaltsc
Alfr: my entry in the clisp world would only be nyxt configuration right now, so I don't have to worry about this kind of stuff
20:22:19
jcowan
I found PCL very readable, but I'm an odd case because I wrote CL (in anger) about the same time I learned Scheme (from reading the Rabbit compiler, which is written in Scheme and Maclisp). I never returned to CL after that except to update myself, but got involved in Scheme much more so.
20:28:11
jcowan
beach: Of course you can define away "unlispy CL features" by saying "Everything in CL is lispy". But if you look at how people actually use the term, they seem to focus on `format` as the most unlispy feature, followed by `loop` and CLOS in that order.
20:28:57
jcowan
I agree about `format`, think `loop` could have been designed better but the idea was a good one.
20:29:51
lisp123
White_Flame: Seems like there is two eras of Lisp - The ones before format / loop / CLOS and the ones after it
20:30:24
White_Flame
well, the old ones really sucked because they used symbol plists as an application database, and did spaghetti mutation everywhere
20:30:30
lisp123
The one before was DIY, you got the primitives, go have fun. The ones after is like, why reinvent the wheel, use these useful tools. That's my two cents
20:32:04
jcowan
There should be a bottom-up MOP+CLOS book that explains how a CLOS is done, analogous to phoe's condition book.
20:33:01
Bike
amop is kind of written like that... though it skips some of the efficiency details and isn't quite in line with the MOP "standard"
20:36:04
lisp123
jcowan: You can also check out Sonja Keene's book and then the standards. Then look at Portable Common Loops
20:38:17
lisp123
https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/oop/clos/pcl/0.html
22:28:23
_death
while debugging something, I wanted to TRACE a function, evaluate a form that calls it, and then UNTRACE it..
22:42:44
_death
jcowan: sure.. but that's too much typing while debugging.. and I knew no error would be signaled
22:49:46
jcowan
What is "dead"? The last release was in 2014, but it is still being maintained. Java weevils will tell you CL is dead, but there are plenty of other weevils who will tell you Java is dead.
23:45:03
yitzi
greyrat: Keep in mind that bordeaux-threads does not support GCL and that several platforms that used GCL to support Maxima now use SBCL or something else.
0:06:35
kagevf
xaltsc: "clisp" is an implementation of Common Lisp - similar to SBCL, ABCL, ECL, and so on ; use "CL" to abbreviate "Common Lisp"
0:17:55
lad
is there a way to hook into the eval function such that I can define my own special symbols?
0:20:51
lad
I want these symbols to be able to self-evaluate: http://pastie.org/p/2HHTbH3yyf4oIqmamUs5rB
0:23:55
lad
I need to figure out how to get around Lthis ock on package COMMON-LISP violated when DO as a constant while in package COMMON-LISP-USER.
0:25:19
Bike
DO is a part of the standard CL package, so you can't define it as a constant. You can define your own package that uses the CL package but shadows DO, and then SOLFEGE:DO can be defined however
0:35:40
pjb
(defpackage "LAD" (:use "CL") (:shadow "DO")) (in-package "LAD") (defconstant do 'do) (defmacro do (&rest stuff) `(cl:do ,@stuff))
0:41:10
lad
http://pastie.org/p/5OfiqsD6UDmqoxakurCNy0 <- line 12 has an issue, what is a good way around this?
0:41:33
lad
say i don't want to define constants, just bindings that I can use within a macro, for example
0:46:04
pjb
Note: with let, they're not constant, so you can shadow them or rebind them: (with-solfege (setf do 42) (list do re mi)) #| --> (42 re mi) |#
0:47:22
lad
pjb, i think those symbols should be able to be rebound since they are relative to a scale
0:50:19
yitzi
lad: Why do you not want to do keywords? The deftype will just have `(member :do :di :re ...)`
0:51:28
pjb
The advantage of symbol-macros is that they're lexical bindings, and you can shadow them in a let (let ((si 42)) (list la si do)) #| --> (la 42 do) |#
0:52:34
lad
yitzi, i don't want to use ":" everywhere. the solfege language doesn't use colons at all so I don't want them
0:56:19
lad
pjb, symbol-macros seems to be exactly what i need in this case. otherwise i'd have to do it via a macro-expanding-to-let form. very interesting, thank you