freenode/#lisp - IRC Chatlog
Search
14:58:21
Xach
schweers: inefficient maybe? i find them very handy and use them 1000000 times per day
15:02:57
schweers
push-package looks funny. I don’t know if I’ll ever use it, but I’ll try to keep an eye out for when it may be useful
15:10:44
ecraven
sloccount says it's 18k lines of lisp code (though I don't know how many of those might be auto-generated)
15:37:52
ealfonso`
does anyone have any experience with websockets on CL? I've heard about hunchensockets and clws. any recommendation between the two?
15:43:47
loke
The implementation is here: https://github.com/cicakhq/potato/blob/master/src/potato/ws-server.lisp
15:44:57
ealfonso`
loke thanks. I've heard that hunchensocket "is not recommended for production use" https://stackoverflow.com/questions/23855626/websockets-from-common-lisp do you know why someone might think this?
15:46:25
loke
I don't know if there is an issue with lots of connections though, I've only tested with a few hundred on a single process.
15:49:20
loke
But it was running off a laptop and I wasn't able to saturate the connections. But the system worked.
16:09:46
Xach
Different things to different people and some are less flexible about needs and context.
16:24:39
drmeister
What are the best resources for teaching a couple of undergraduates with little to no programming experience Common Lisp?
16:26:28
drmeister
They are committed for the summer - they already have a working Common Lisp environment (Cando/Clasp in a jupyter notebook). Emacs is being installed today.
16:26:53
Xach
drmeister: I like Practical Common Lisp and Paradigms of AI Programming very much. The latter is dense but rewarding.
16:27:43
drmeister
We've started with Practical Common Lisp and we have a copy of Land of Lisp - we have found a couple of web tutorials and we are running a boot camp.
16:31:01
Josh_2
When I was a nub I found PCL too hard, but Gentle introduction to symbolic computation was perfect when I had no programming experience
16:33:49
sjl
I also recommend Gentle first, then Practical, then go make things for a while, then maybe PAIP or CLR
16:34:21
ealfonso`
I never read any Common Lisp book. I started with emacs lisp and the emacs lisp manual, which is very user and beginer friendly. It wasn't hard to transition to CL. I may still be a noob though
16:34:52
Xach
ealfonso`: i think it would be helpful to read common lisp books and code in that case.
16:35:14
sjl
also throw "watch the SICP lectures" somewhere in there. not strictly about CL, but still really helpful
16:37:51
antoszka
From what I know now, I'd recommend starting with PAIP. Then using PCL (and Edi's excellent recipes) as a *practical* guide/reference.
16:38:44
antoszka
Scheme related stuff (PAIP lectures, * Schemer books) is good, too, but doesn't pertain to Common Lisp that much.
16:39:20
Xach
I think it can be helpful to learn about new ways of thinking about problems and solutions
16:40:46
jmercouris
it's not challenging to learn IRC, if they can't learn it, they won't have much luck with CL
16:53:11
ealfonso`
Xach what if you look at a random sample of my code https://pastebin.com/GCKGpn2B and tell me how bad you think it is and whether I still need to read common lisp books?
16:54:32
jmercouris
a measure of skill would be simple, are you able to do anything you'd like to do with the language in a timely manner?
16:58:49
ealfonso`
Josh_2 yeah, I did that while making lots of changes to a defstruct, I wanted git commits to be one-line changes, then forgot to close it.
17:01:03
ealfonso`
jmercouris I was able to write this restful front-end to my C library in about a week: http://ec2-54-213-11-217.us-west-2.compute.amazonaws.com/
17:01:54
jmercouris
I have no way of judging that, nor is it my place to, I'm not an employer considering you nor am I condeming
17:02:37
jmercouris
don't worry about whether you are "pro" or not, when it comes time, and you need to learn more to get something done, you will learn it
17:03:53
ealfonso`
jmercouris I just don't think reading dense programming books is necessarily always the best approach. some people might learn more quickly by doing
17:05:10
comborico1611
As long as I don't get lost, I consider the programming book a win. :-) Going to lunch!
17:05:16
Xach
If you rely only on learning by doing and teaching yourself, you will have gaps. It is possible to learn on your own and accomplish many great things. But I think you can do greater things by reading some other stuff.
17:06:02
jmercouris
there will be gaps in your knowledge only if you learn *just enough* to accomplish what you set out to do. If you explore the topics of things that you use, you shouldn't have many gaps
17:57:39
araly
hello everyone, I'm having a question about CLOS, using the lispcord library if that helps. There's a class called guild which has a id slot, and I have instances of a class called available-guild, which inherits from the guild class. I'm trying to access the id slot of my object, but it says that the slot is missing from the object
17:59:40
araly
(slot-value (lc:guild msg) 'id) is my bit of code, (lc:guild msg) returns an instance of available-guild
18:00:51
araly
the class available-guild inherits from the class guild, and the class guild has a (id :initarg :id :type snowflake :accessor id) slot
18:00:58
sjl
araly: what they said. you should be using the accessor function though, not calling `slot-value` directly
18:02:02
sjl
araly: if you're not importing the `id` symbol from that package, then you're trying to effectively do (slot-value ... 'some-other-package:id) instead of (slot-value ... 'lc:id)
18:02:07
Bike
:accessor makes a reader and writer function. you're not using those, you're using slot-value
18:03:07
sjl
slot-value is a low-level function. if there's an accessor, you should generally prefer using that.
18:04:00
araly
which function is that, something from CLOS or something that should exist in the package ?
18:04:35
sjl
araly: I don't know what the lc package is. Is it a nickname you're defining for one of the lispcord packages?
18:05:18
sjl
araly: okay, so here's where guild is defined: https://github.com/lispcord/lispcord/blob/master/src/classes/guild.lisp
18:05:59
araly
yeah I see that, that's where I looked the accessor up, but there isn't anything more in the defclass guild
18:06:09
sjl
that's in the lispcord.classes package. it defines the guild class with a slot with name `id` in that package, and accessor named `id` in that package
18:06:37
sjl
Defining that accessor means there will be a function called `id` in the `lispcord.classes` package that will take a guild and give you its id
18:07:12
sjl
if we look in the packages.lisp file in that directory https://github.com/lispcord/lispcord/blob/master/src/classes/package.lisp we can see that the package exports that `id` name
18:07:34
araly
okay, so the accessor itself doesn't do anything, it just says that there will be a function
18:08:19
sjl
aha, here's where the magic name lc comes from: https://github.com/lispcord/lispcord/blob/master/src/classes/package.lisp#L170-L172
18:08:54
Bike
the :accessor specifies that there should be reader and writer functions, and that they should use the given symbol in their names
18:11:50
araly
okay, it worked, I don't really understand why though, is the lc:id a function that exists because of the :accessor, and it knows that it's has to be the id from an available-guild instance, because it has that in parameters ?
18:13:25
araly
so what is the slot-value for, because it works for a class I have created, but where I don't accessors. Should I write accessors and use this instead ?
18:14:00
sjl
when you say (defclass foo () ((some-slot :accessor some-accessor))) lisp will create the class with a slot named some-slot. It will also create (if it doesn't already exist) a generic function called some-accessor, and will define a method on some-accessor for members of class foo
18:14:23
sjl
by convention, a lot of people use the same symbol to name the slot and the accessor function
18:14:28
jmercouris
araly: I think it would be a good idea to stop what you are doing, and read about CLOS
18:16:01
sjl
If you want a really good intro to CLOS, Keene's book is a good resource. It's worth spending a while getting the basics down.
18:18:20
sjl
There are PDFs floating around of it, unsure how legal they are. I own two paper copies because I bought a second while I was in grad school rather than shipping my copy I left at home across the ocean.
18:20:28
araly
lisp is a language I learn on my own for fun, so I have a more try and read when you can't approach, I think it's time to read a bit further than just to be able to keep going ^^
18:21:52
jmercouris
sjl: sure, type :q, then when you drop back into the terminal, type in emacs to get a sensible environment
18:36:58
White_Flame
is this the most compatible/safe way of getting the directory of a file? (make-pathname :defaults filename :name nil :type nil)
18:49:12
White_Flame
I have some old cygwin path support in my lisp build tools. With the various linux subsystems in newer windows, and VMs being more popular, do you think cygwin usage is going to drop away?
19:05:42
ZigPaw
for me WSL superseded Cygwin on all windows machines I use. It is just plainly easier to use as I can leverage all of the software packaged in ubuntu and not to worry if something will compile under cygwin.
19:21:08
aeth
I thought WSL isn't graphical? I know Emacs outside of the terminal has more features, like more colors available for better syntax highlighting, and PDF reading.
19:25:36
White_Flame
I'm doing build scripts from a very raw environment, can't depend on libs being loaded yet
19:25:59
jasom
White_Flame: well you can copy the source-code for that then. It's a single .lisp file to load it as well.
20:23:23
dtornabene
so I've got a library (cl-async) with a bugfix that doesn't seem to have migrated up to a new package yet, i.e. the fixed library isn't available on quicklisp yet
20:23:50
dtornabene
my question is: should I download the fixed library from github and just install it via the local-projects mechanism?
20:25:16
sjl
don't forget step 2: forget you did this until six months later when it breaks something because you're running an old version
20:25:49
sjl
I should clean out my local-projects every time I update the quicklisp dist, but I forget
20:25:51
dtornabene
its like the third thing to go wrong loading another library and I'm getting perilously close to saying "yeah, nah....."
20:57:22
Xach
It would be interesting (and easy to implement) to have an easy way to see local projects that shadow quicklisp projects.
21:02:33
dtornabene
irony of it is that I had the quicklisp source queued up in another window to do some reading specifically to see what other commands there were that I haven't learned yet and I had to spend time trying to get another library to load
22:28:31
ZigPaw
aeth you can run X Server on windows and have WSL apps using this (MobaXTerm works best with latest emacs snapshot).
22:54:20
drunk_foxx[m]
But honestly this intro video tells almost nothing about the language, I bet it could have been done better. But whatever
23:35:20
didi
Heh, I'm having a brain fart. So (loop for fn in (loop for i to 3 collect (lambda () i)) collect (funcall fn)) evals to (4 4 4 4), but I want (0 1 2 3), i.e. I want the thunk to have the value of 'i' when it was created, not a reference to 'i'. What to do?
0:28:05
stylewarning
drunk_foxx[m]: the first take of the video did everything from defining the syntax of S-expressions and etc etc
0:54:40
Xach
didi: https://www.youtube.com/watch?v=svmPz5oxMlI - i'm not familiar with the channel but it has a big audience
2:40:51
ealfonso
is there something better than: (format log-fh "~A~A~A~A~A~A~A~%" ip #\tab date #\tab user-agent #\tab path)
2:49:10
ealfonso
I heard of this http://www.sbcl.org/manual/Statistical-Profiler.html which gives me 404