freenode/#lisp - IRC Chatlog
Search
15:47:15
jmercouris
unfortunately, whenever I start Lispworks (personal edition) I have to manually enter in that stuff to start slime
15:57:13
jmercouris
Lycurgus: I'm not sure what you are saying, I have this .lispworks file where I am trying to launch Swank server with Lispworks, but it doesn't start it
15:59:34
jmercouris
I have SBCL as well, I'm looking to create a cross-platform user interface for a non-profit product, CAPI is the best
15:59:45
Lycurgus
but at least they don't try to take a cut of everything you make or charge for the run time
16:01:46
Lycurgus
if the resource usage is modest you can use their (LWs) version, work around the crippling
19:18:11
Josh_2
Although I thought there was a way with closer-mop (i think) that you can actually list the slots in a class
19:32:20
shka_
define generic function that will return list of slot names when called with the class name
19:35:56
Josh_2
I have my version of (with-accessors ..) and I defparamed a var which contains the the accessor names as symbols
19:47:15
shka_
if anyone is interested, that's how i do it https://github.com/sirherrbatka/cl-data-structures/blob/0e5df4640ade420305f2535453848a2bd67a5545/src/utils/macros.lisp#L318
19:50:11
saturn2
i don't see the problem with eval-always-ing your class definition if you want to use it at compile time
19:51:59
shka_
it wanted to call it lol (let over let) but in reality it is usually over lambda so it is let over let over lambda
20:03:52
ck_
A higher amount than usual of lisp on hacker news at the moment. Have I missed some anniversary?
20:05:02
aeth
ck_: I think people are just seeing what's getting karma and reposting old things for karma
20:06:23
aeth
Repost this one, "Beautiful Online SICP" (762 points in 2017): https://news.ycombinator.com/item?id=13918465
20:08:44
aeth
Mezzano was posted 19 days ago so that is probably too soon. Some others here could think of something, I'm sure, though.
20:09:31
aeth
borodust: You could try doing a Show HN of trivial-gamekit since HN's hivemind is filling its front page with Lisp articles right now. i.e. https://borodust.org/projects/trivial-gamekit/
20:31:09
Josh_2
hmm, so I can't use (setf (funcall accessor instance) "abc") :( Is there a way I can get around this?
20:42:31
aeth
borodust: ck_ is right, the front page is currently full of Lisp stuff for some reason. https://news.ycombinator.com/news
20:51:31
_death
it will only work if there's a function called (setf accessor) and the two last arguments transposed, assuming "abc" is the new value
20:51:35
dialectic
However you're passing accessor in, pass this instead: (cons #'accessor #'(setf accessor))
20:58:42
Josh_2
Okay that worked, but my logic was broken anyways. Thanks _death I'll fix when I get back
21:09:19
_death
Josh_2: in this case it may be enough just to read a list of initargs and (apply #'make-instance 'data-entry initargs)
21:16:05
dialectic
#| stuff |# is also used for (nestable) comments, so careful with that too if you're making a dispatch character.
21:19:51
MichaelRaskin
Well, borderline: they use that it looks || in code and ignore the fact that it has empty name
21:21:33
stacksmith
Yeah... It's kind of hard to enter it any other way than ||, so as much as I want to object to it, I can't find a good reason... I suppose (find-symbol "") to get '|| may be a little confusing.
21:43:23
fiddlerwoaroof
By the way, shka__, data-lens now has "real" Van Laarhoven lenses: https://github.com/fiddlerwoaroof/data-lens/blob/master/lens.lisp#L83-L127
21:45:44
fiddlerwoaroof
This, so far, is the public interface: https://fiddlerwoaroof.github.io/data-lens/The-data_002dlens_003cdot_003elenses-package.html#The-data_002dlens_003cdot_003elenses-package
21:48:04
fiddlerwoaroof
The advantage of this is that you don't need to depend on a specific lens library to provide lenses: a lens is just a function that works in a certain way and any such function will be compatible with DATA-LENS.LENSES:VIEW, DATA-LENS.LENSES:SET, and DATA-LENS.LENSES:OVER
21:48:29
fiddlerwoaroof
Also, these functions use the "traditional" names for the lens operations, so they'll be more familiar to people coming from other languages.
22:26:31
dialectic
lenses seem vaguely inappropriate for a language like common lisp where I can iterate over slot values or use symbols to set arbitrary slots.
22:33:51
saturn2
common lisp doesn't come with a convenient built-in way to make modified copies of arbitrary objects without mutation
22:34:38
oni-on-ion
R and Julia have things called 'DataFrame' which is kind of like a lense into arbitrarily large data sets, but less about code and more about data (afaik)
22:38:12
dialectic
saturn2: I mean, sure. But how is that any worse or better than a "lens"? You could use one macro, for all cases.
22:38:35
dialectic
Admittedly my functional-fu is weak in this area. I know this won't work for the "applicative" pattern.
22:48:02
fiddlerwoaroof
Lenses are really nice, because if you have two lenses, simple function composition composes the "pointers"
22:49:18
fiddlerwoaroof
And, thy are just "values", so you can pass them around, allowing you to separate "what" a function operates on from the operation applied.
22:50:11
fiddlerwoaroof
Accessors, etc. are handy and, to some degree, overlap with lenses but a significant difference is that setting a lens copies the underlying object, while setfing an accessor mutates it: both have their place, but lenses preserve encapsulation a bit better
0:26:35
vsync
is there anything already to simplify the situation where one wishes to define a protocol and specify methods which may be readers but without imposing a slot requirement?
0:26:54
vsync
this may go into the question of protocol declaration which I'm sure has been discussed before
1:11:05
Ankhers
Hey, I'm just getting started with lisp. Can anyone suggest some books, blog articles, whatever else that they consider to be essential learning materials?
1:11:27
vsync
pjb: naturally but wondering if there is a nicer way that allows for writers and for grouping with protocol (classes)
1:12:14
pjb
vsync: there are various macros to deal with the problem of interfaces, with various features, in systems such as asdf and others.
1:12:28
vsync
something like (defclass foo () ((bar :allocation nil))) modulo of course the redundancy of slot-/accessor-name
1:12:50
vsync
though I'm realizing this may encompass a larger question so I may write and post that
1:13:18
vsync
pjb: naturally, more curious if there is such a thing intended generically, or a convention
1:13:45
pjb
vsync: notably, there you assume a CLOS class. But a protocol can be implemented with different kinds of objects. (structures, vectors, database backends, etc).
1:16:11
vsync
thought I ran into something about protocols some time ago that thought the way I thought about them... and certainly kicked it around here before
1:23:33
Josh_2
phoe was talking about it a few weeks back, I'm will ask him when it is a reasonable time
1:29:15
Josh_2
although I'm pretty sure he mentioned something about having to actually write the sql statements and not using a dsl
1:45:22
aeth
Someone should write some multithreaded CL benchmarks so we can compare CPUs and implementations. (Maybe those already exist?)
1:48:52
oni-on-ion
there always seems to be something about benchmarks they are either not specific enough or too specific
2:31:03
vsync
I'm trying to (re-)grok the rationale for having both a protocol class and a predicate