Xach changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook>
meraz_1 has quit [Remote host closed the connection]
<Josh_2> I think this is a CL daemon
<Josh_2> thats why I suggested it
<akater[m]> <nirnam> "have anyone created gnu info..." <- There's an info version of the standard draft. Two of them, actually. A `.tex` copy of a standard can be converted to texi, then to info, pdf, html. I did build it recently. clhs is still more convenient.
<akater[m]> I probably should not have used the “reply” feature of Matrix in an IRC channel.
tankrim has quit [Remote host closed the connection]
<akater[m]> Unlike CLHS, the draft of the standard is very likely in public domain.
tux0r has quit [Ping timeout: 252 seconds]
<Xach> akater[m]: that is what i was assured by kent pitman
random-nick has quit [Ping timeout: 272 seconds]
taiju has quit [Ping timeout: 256 seconds]
sjl has joined #commonlisp
defaultxr has quit [Quit: bbiab]
mister_m has quit [Ping timeout: 240 seconds]
sjl has quit [Quit: WeeChat 2.2-dev]
zacts has joined #commonlisp
taiju has joined #commonlisp
zacts has quit [Quit: Client closed]
zacts has joined #commonlisp
zacts47 has joined #commonlisp
zacts has quit [Killed (NickServ (GHOST command used by zacts47))]
zacts47 is now known as zacts
zacts has quit [Quit: Client closed]
mister_m has joined #commonlisp
zacts has joined #commonlisp
zacts has left #commonlisp [#commonlisp]
Guest8213 has joined #commonlisp
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Client Quit]
lisp-newbie has joined #commonlisp
lisp-newbie has quit [Client Quit]
lisp-newbie has joined #commonlisp
prxq has joined #commonlisp
prxq_ has quit [Ping timeout: 258 seconds]
wilfred has quit [Quit: Connection closed for inactivity]
beach` is now known as beach
<beach> Good morning everyone!
<etimmons> Josh_2: that link does not describe scripting with a CL daemon. cl-launch can make startup time fast by dumping your script as an image
<etimmons> Good night, beach. I'm always getting in bed when I see your greeting
<beach> 'night etimmons.
lad has quit [Ping timeout: 272 seconds]
tyson2 has quit [Remote host closed the connection]
<kakuhen> what are the chances of another common lisp spec happening
<kakuhen> i notice a lot of people saying it will basically never happen again, but why? are the maintainers of major implementations too stubborn to get together for a week and agree on some changes?
<kakuhen> like how did bordeaux threads go so well but everything afterwards didn't
<beach> kakuhen: The cost of something like what the ANSI committee did was estimated to about a million USD as I recall.
<beach> There may be less prestigious specifications like WSCL, but probably not by any major standardization organization.
<beach> And if you think it is a matter of "getting together for a week", you seriously underestimate the issues of programming-language design.
<kakuhen> well i dont mean literally a week
<beach> kakuhen: But don't worry. You are not alone. We regularly have people come here and suggest "improvements" to the standard, while being clueless about the implications in terms of what the compiler can do.
<kakuhen> but some span of time
<kakuhen> i know the original CL spec didnt happen overnight, and if i had to guess the time it took to even get a draft, probably years
<beach> kakuhen: Yes, it is more a matter of a year for a dozen people or so.
<beach> kakuhen: A more important question is: why do you care? People use languages without an independent standard every day.
<beach> Like Python, Java.
<kakuhen> Right, but in the case for Python, there almost a "canonical" implementation people flock to (CPython). Is that true for Common Lisp?
<moon-child> beach: does https://docs.oracle.com/javase/specs/ not constitute a standard?
<beach> I wrote something about this. Let me see whether I can find it.
<kakuhen> When the standard marks something as deprecated, and the standard never changes, then isn't it meaningless to consider it deprecated?
<beach> moon-child: Correct, it does not. If it is published by the same people who supply the implementation. Hence "independent".
<kakuhen> my issue isn't with the standard never changing, but if the standard implies something is prone to change, then I think it's reasonable that some people ask "when will that happen? if at all?"
<beach> kakuhen: The solution is simple. Pick an implementation and forget the others exist. Then you have the same situation as Python.
<beach> Problem solved.
<beach> kakuhen: I find it fascinating that people are willing to use something like Python which does not have an independent standard, but which is mainly defined by a "canonical implementation", but then, when it comes to Common Lisp, suddenly, they are worried about the standard not being updated, even though they could just forget about all but one implementation, and be in the exact same situation as with Python.
<kakuhen> Because CPython dominates all of the other Python implementations. Usage statistics from Quicklisp suggest SBCL is very close to a "canonical" implementation, but it's nowhere near the situation of say CPython vs. Jython
<kakuhen> and often times I find myself having to worry how other implementations may handle some aspects of the standard that let them do pretty much whatever they want
<kakuhen> e.g. RANDOM
<kakuhen> granted, there is probably a random number library out there that works fabulously across implementations, but the closest I've got to one gives looots of style warnings from SBCL
<kakuhen> with that said, common lisp seems to be in a great position where you can simply load the relevant libraries for what you want that isn't covered well enough by the standard, but this still doesn't satisfy my point earlier regarding deprecations
<beach> kakuhen: If you give it some thought, I think you will see that the situation is much worse with something like Python, all aspects of which can change overnight at the whim of some maintainer.
<kakuhen> i.e. if the standard declares something as deprecated, then should I look for a library or risk using what's marked deprecated by the standard and assuming it will never change?
<beach> kakuhen: I suggest you read that page I gave a link to.
<kakuhen> I am currently reading it, yes.
<beach> Also, look at the channel logs. This question comes up several times a year. You won't add anything to the existing information.
<lisp-newbie> List question: I have a list where every car is itself a cons which is a key value pair, I want to get the value for a certain key, but it's not a plist because each car is not a key, it's another cons which is a key/value cons. Does anyone know how can I do this?
<lotuseater> lisp-newbie: maybe an example to see it would help
<beach> I was about to say the same.
<lisp-newbie> ("name" . "sample - 24, 712"))
<lisp-newbie> (("askdj" . 190238) ("asd" . 12) ("id" . 24)
<hayley> So, it looks something like ((key1 . value1) (key2 . value2) ...)?
<hayley> clhs assoc
<lisp-newbie> That's the log output
<lisp-newbie> yeah
<lotuseater> cause i realize that I'm tired but the description is hard to catch
<lotuseater> hayley: yeah also thought of assoc
<beach> lisp-newbie: It is an "association list" as hayley says.
<lisp-newbie> Thanks
<lisp-newbie> Reading the link now
<hayley> If your keys are strings, you should provide :KEY #'STRING= too.
<lisp-newbie> I'm trying to parse json
<beach> :TEST?
<hayley> Right, :TEST rather. Whoops.
<lisp-newbie> I thought there would be an out-of-the box method for just getting a key
<beach> lisp-newbie: There is.
<lisp-newbie> Oh, which one beach?
<lotuseater> lisp-newbie: and if you "know" all keys will be of type string you can provide ":test #'string=" to ASSOC
<lotuseater> damn hayley you typed faster than me :)
<lisp-newbie> Trying now
<lisp-newbie> Thanks
<beach> lisp-newbie: (assoc <the-list> <key> :test #'string=)
<lotuseater> I should sleep. See you later.
Qwnavery has quit [Read error: Connection reset by peer]
<hayley> Take care.
<lisp-newbie> Oh haha beach you are saying that is the default way of doing such a thing? the framework I'm using just turns it into an assoc list and that's how to do it.
<lisp-newbie> Thanks guys!
<lisp-newbie> I debugged for 2 hours
<lotuseater> but I wonder what ":key #'string=" will signal ...
<lisp-newbie> Should have just asked...
<lotuseater> lisp-newbie: assoc-lists are useful when dealing with small amounts of key-value pairs. anything beyond that is better to handle with hash tables
<lisp-newbie> Thanks lotuseater
<lisp-newbie> (assoc (lack.request:request-body-parameters *request*) "id" :test #'string=) this gave me an error: Constant "id" conflicts with its asserted type LIST.
<lotuseater> but I don't have a clue yet where this breaking line is
<lisp-newbie> Beach I was trying to follow your formula
<lisp-newbie> I probably misunderstood something
<beach> lisp-newbie: I may have gotten the argument order wrong.
<beach> lisp-newbie: You need to look at the Common Lisp HyperSpec page.
<lotuseater> I think the first two arguments must be the other way around.
<lisp-newbie> Looking at the spec now
<lisp-newbie> Thanks
<lotuseater> this is one of the good things when using SLIME or friends, typing a known symbol as operator and it shows you good named arguments and possible keywords etc in the bottom bar
<lotuseater> *well named
<beach> lotuseater: I use that feature all the time, which is why I don't have to remember this information myself.
<lisp-newbie> Yeah, will learn slime soon
pillton` has joined #commonlisp
<lisp-newbie> How about embedded keys?? Do I have to do the same assoc twice? Or is there a direct way to do it? Say:
<lisp-newbie> (("hello" ("world" . 26))
<lisp-newbie> ("asd" . 12) ("id" . 24)
<lisp-newbie> ("name" . "sample - 24, 712"))
<lisp-newbie> ("askdj" . 190238)
<lotuseater> yes it's a lifesaver feature. I remember a time where I didn't use it and thought "oh noez what did this had as keywords?"
<lisp-newbie> Has "world"
<lotuseater> lisp-newbie: better use a paste site for that
<lisp-newbie> Sorry, thought it was short enough, you are right
<lotuseater> ah no problem :)
<lotuseater> with the ":KEY" keyword in assoc you an specify a place where to look
<lotuseater> but that isn't of much use for your question
pillton` has quit [Client Quit]
<lisp-newbie> Ok, thanks so much guys
pillton has quit [Ping timeout: 256 seconds]
<lisp-newbie> Calling it a night
lisp-newbie has quit [Quit: Leaving]
Guest8213 has quit [Quit: Client closed]
taiju has quit [Ping timeout: 272 seconds]
White_Flame has quit [Remote host closed the connection]
White_Flame has joined #commonlisp
taiju has joined #commonlisp
Mandus has quit [Ping timeout: 265 seconds]
akoana has left #commonlisp [Leaving]
Mandus has joined #commonlisp
Mandus has quit [Ping timeout: 265 seconds]
Mandus has joined #commonlisp
meraz_1 has joined #commonlisp
meraz_1 has quit [Remote host closed the connection]
<kakuhen> Is there a neat way to "cast" the type of a bignum to, say, (unsigned-byte 64)? Right now I am simply taking the integer modulo 2^64 to achieve this.
<beach> So you just want to ignore upper bits, even if that means returning a different value than that of the original number?
<kakuhen> Yes
<kakuhen> The context of this problem is an implementation of a circular shift
<beach> Modulo is fine then. Or you can use a masking operation.
<kakuhen> As of now, my expression is (mod (logior (ash value count) (ash value (- 64 count))) #.(expt 2 64))
<moon-child> I think that will not behave correctly if your input is greater than 64 bits; you should mask before shifting
<moon-child> (let ((mask #.(1- (expt 2 64)))) (logand mask (logior (ash value count) (ash (logand value mask) (- 64 count)))))
<hayley> I typically write (ldb (byte 64 0) value) to get the lower 64 bits of VALUE.
<hayley> If you use SBCL then you could use SB-ROTATE-BYTE to generate the right machine instruction for a circular shift, and then use a portable implementation for other Lisp implementations.
nirnam has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Read error: Connection reset by peer]
Lord_of_Life has joined #commonlisp
<kakuhen> I see. I'm using CCL so I decided to just write the usual C version "directly," without considering the fact it's non-portable across architectures :x
Lord_of_Life_ has joined #commonlisp
nirnam has joined #commonlisp
bpanthi977 has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
selwyn has joined #commonlisp
taiju has quit [Ping timeout: 265 seconds]
<hayley> I don't see why it would be non-portable, assuming you wrote it in Common Lisp. Then it would merely go slower if the implementation requires bignums to work.
nirnam has quit [Quit: leaving]
taiju has joined #commonlisp
Qwnavery has joined #commonlisp
psycomic has joined #commonlisp
rt has joined #commonlisp
robin has quit [Ping timeout: 245 seconds]
<kakuhen> Is there something like #'float but for double-float? My implementation only seems to offer double-float as a class and type
pve has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
<beach> clhs float
<beach> Do you see the optional parameter PROTOTYPE?
lad has joined #commonlisp
<kakuhen> Yes
<kakuhen> So presumably my prototype is 1.0d0
<kakuhen> Just to be sure, I am comparing the results to (coerce <expression> 'double-float)
<kakuhen> Ok cool this works -- thank you so much, beach.
Inline has quit [Quit: Leaving]
<beach> Sure.
gaqwas has joined #commonlisp
Inline has joined #commonlisp
nirnam has joined #commonlisp
bpanthi977 has quit [Remote host closed the connection]
bpanthi977 has joined #commonlisp
peterhil_ has joined #commonlisp
peterhil has quit [Ping timeout: 256 seconds]
hendursa1 has joined #commonlisp
hendursaga has quit [Ping timeout: 244 seconds]
flip214 has quit [Changing host]
flip214 has joined #commonlisp
tfeb has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
Qwnavery has quit [Read error: Connection reset by peer]
tfeb has quit [Quit: died]
CrashTestDummy2 has quit [Ping timeout: 272 seconds]
bpanthi977 has quit [Ping timeout: 272 seconds]
<beach> We now have 35 WSCL issues defined: https://github.com/s-expressionists/wscl/tree/main/wscl-issues/proposed and, as before, help would be appreciated where these issues need to be checked on more implementations.
dsk has quit [Ping timeout: 272 seconds]
kpoeck has joined #commonlisp
kpoeck has quit [Ping timeout: 246 seconds]
lad has quit [Ping timeout: 272 seconds]
<contrapunctus> nirnam: why not use Emacs? With Evil you have a complete implementation of Vim editing. You can use TRAMP to access remote machines. The Lisp tooling, I hear, is unparalleled in Emacs. So...why not? 🤔 (also, EWW is a great browser for documentation - mostly textual, but can also display images.)
<nij-> Emacs takes times to learn. It'd be a slightly painful learning process who has settled in their systems that fulfill most of their needs.. or at least it was how it felt for me before I switched to emacs ;)
<nij-> But really.. I think the fundamental difference between emacs and vim is that emacs is lisp, but vim is not. That lisp is better could be obvious to lispers, but I find it hard to explain to those who aren't.
<phoe> What is the currently recommended CL setup for vim?
nature has joined #commonlisp
kpoeck has joined #commonlisp
Lycurgus has joined #commonlisp
<pjb> beach: I've posted my comments in a PR https://github.com/s-expressionists/wscl/pull/1 Feel free to integrate them as you wish and reject the PR, it's not to be taken literally.
kpoeck has quit [Ping timeout: 246 seconds]
tux0r has joined #commonlisp
nature has quit [Quit: Lost terminal]
<lotuseater> Has anyone advise or sources to fully understand continuations? I think I don't up till now. I know and worked through the chapter in "On Lisp" by Paul Graham some times, knowing how to define the needed macros is indispensable.
<MichaelRaskin> For continuations I would recommend _Scheme_ explanations of things like amb macro
<hayley> A continuation is "merely" the rest of the computation. If you reify a continuation as a function, then calling the function will run the rest of the computation.
<lotuseater> thx you two :) I got it like it's some sort of runtime goto and then "all you need is call/cc"
<nirnam> contrapunctus: tho I understand why emacs is a superior lisp IDE, vim is much more fitting in my environment
<beach> pjb: Thanks.
kakuhen has quit [Quit: Leaving...]
<lotuseater> hayley: isn't it also aware of what happened before?
<hayley> No.
<contrapunctus> nirnam: hm...how's that?
<lotuseater> so this was a lie they told me
<hayley> Who are "they"?
<lotuseater> nirnam: so what's your environment
<lotuseater> hayley: authors of articles about the topic
<lotuseater> there's also a book "Compiling with continuations"
<nirnam> it system adminstrator setting, I only doing lisp for curiocity, most of the time I have to ssh to a machine, get in, get out, go home
<lotuseater> okay that seems reasonable
<lotuseater> you could also have a SLIME clone for vim
<nirnam> I was using vlime at the moment
<nirnam> been serving me well
<lotuseater> nice
<akater[m]> I have to say, there is at least one use case for the Info version of ANSI standard: full-text search is faster than in CLHS.
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
random-nick has joined #commonlisp
cage has joined #commonlisp
tyson2 has joined #commonlisp
rt is now known as robin
tankrim has joined #commonlisp
<susam> Hello! Is hunchentoot a good choice for web server? I need something simple that can accept an HTTP request, parse its GET or POST parameters, send back a response, etc.
<pjb> Hunchetoot can do that.
<susam> pjb: Thanks!
tux0r has quit [Ping timeout: 240 seconds]
<susam> lotuseater: Thanks. I have the documentation. It does seem to have what I need. My reason for asking here was to check if Hunchentoot is still a good recommendation or if the community recomends something else.
azimut_ has quit [Quit: ZNC - https://znc.in]
azimut has joined #commonlisp
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
tux0r has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
pranavats has left #commonlisp [Disconnected: Replaced by new connection]
pranavats has joined #commonlisp
rain3 has joined #commonlisp
<lotuseater> How can one class inherit all but one slot from another?
<phoe> lotuseater: what are you trying to do?
<lotuseater> or I make the content (just a boolean) of this slot static to T or NIL
<beach> lotuseater: That sounds completely contrary to the very idea of inheritance.
<phoe> due to Liskov substitution principle, if you have FOO that is a superclass of BAR, then every BAR is a FOO
<lotuseater> yes it does and I don't need it necessarily ^^ sry
<phoe> so every BAR should function in a context where a FOO is needed
<lotuseater> yes of course I know that
<phoe> so (slot-value bar 'some-slot) should function if (slot-value foo 'some-slot) is a part of your documented interface
<phoe> so, in other words, you can't do that and if you could then you shouldn't so that because you break LSP
<phoe> s/so that/do that/
<phoe> what are you trying to do?
<lotuseater> it's not of importance
<hayley> .oO( Maybe lotuseater wants to do Self-esque protocols where methods can override slots, but this is Common Lisp, so we are doing generic function oriented programming... )
<phoe> well, that's possible, yes
<hayley> That kind of overriding is also done in Brachaware like Newspeak and Dart and I think it's almost doable in Lisp, if you think of the interface being generic functions and initargs for MAKE-INSTANCE.
<lotuseater> I just have a class VERTEX (for graphs) with a slot DIRECTED of type boolean, so when T at inizialization it will be changed to class DIRECTED-VERTEX which should inherit from VERTEX but doesn't need the DIRECTED slot anymore necessarily.
<lotuseater> it was just a thought that came to my mind
<hayley> Then the slot is unnecessary, and you could have a method like (defmethod initialize-instance :after ((v vertex) &key directed) (when directed (change-class v 'directed-vertex))) if I recall correctly.
<lotuseater> ah indeed that would be better :)
<lotuseater> I wasn't sure if I can provide to that a new key.
<phoe> I have been wondering if a CHANGE-CLASS is allowed to occur there
<phoe> which is, whether (make-instance 'verteX ...) is required to return something whose CLASS-OF is VERTEX and not a subclass
<lotuseater> would also be enough with class VERTEX
<hayley> "The generic function make-instance creates and returns a new instance of the given class."
<hayley> Too vague to tell.
<phoe> "the given class" though
kevingal has joined #commonlisp
<phoe> it's "the class VERTEX", which suggests EQ rather than SUBTYPEP
<phoe> s/SUBTYPEP/SUBCLASSP/
<_death> or you can not abuse change-class and just create an instance of the right class
<hayley> Or does directed-ness need to be stored in the class?
<phoe> depends on the approach one takes
<phoe> can be composition over inheritance, at which point a DIRECTEDP slot can work just fine
<phoe> but I'd actually make a DIRECTED-MIXIN and UNDIRECTED-MIXIN and define DIRECTED-SLOT to have superclasses (DIRECTED-MIXIN VECTOR) because why not
<phoe> s/DIRECTED-SLOT/DIRECTED-VECTOR/
<hayley> Someone told me the origins of "composition over inheritance" were in mixins.
<phoe> that works too, but note that a lot of OO systems out there either do not have multiple inheritance or do but shun it
<phoe> so in their context composition is storing stuff in slots, rather than mixing in flavors
<hayley> Seems it would be Bracha-ware again as http://www.bracha.org/oopsla90.pdf talks about "inheritance mechanisms [being] subsumed in a new inheritance model based on composition of mixins".
bpanthi977 has joined #commonlisp
<akater[m]> lotuseater: “inherit all but one slot” sounds like you simply need to invert one link in the inheritance lattice. If you want a to inherit all but one slot of b, it should rather b inherit from a and add the slot in question.
bpanthi977 has quit [Remote host closed the connection]
<pjb> Or you may neutralize a slot by overriding its accessor, as long as you do it preserving the Liskov Substitution Principle.
bpanthi977 has joined #commonlisp
<hayley> That would be the .oO( Self ) style, but you still have to kill the slot.
<phoe> or simply not export it
<phoe> if the slot is an implementation detail then not using it is wasteful, but fine
<pjb> (defclass colored-square () ((color :initform 'red :accessor color) (side :initarg :side :accessor side))) (defclass square () ((color :initform 'nil))) (defmethod (setf color) (new-color (square square)) (error "a square cannot be colored"))
<pjb> But you need to update your pre- and post-conditions for color and (setf color)!
<pjb> To do it cleanly, ie. as akater[m] said, you can also use mixins thanks to multiple-inheritance.
<pjb> (defclass colored-square (square colored-object) ()) (defclass uncolored-square (square) ())
<lotuseater> yeah okay or just staying with VERTEX could also be enough
<pjb> Most often, classes are defined without expliciting their invariants, and the pre- and post-conditions of their methods. Therefore the LSP is trivially ensured by assuming the trivial conditions and invariants (NIL and T).
<pjb> ie. you use the object only to store data, and you can call the methods in any order whatever the state of the object.
tfeb has joined #commonlisp
tfeb has quit [Client Quit]
peterhil_ has quit [Ping timeout: 265 seconds]
kevingal has quit [Remote host closed the connection]
tfeb has joined #commonlisp
<nij-> Hello, if I understand correctly, when I run (ql:quickload :slynk), this line will be evaluated: https://github.com/joaotavora/sly/blob/master/slynk/slynk.asd#L112
<nij-> This will in turn evaluate the file slynk-retro, which defines a package "slynk-retro" and some functions under that package.
<nij-> However, I the package isn't defined and the functions aren't defined either. Something must be wrong..
<pjb> nij-: no, this line is purely declarative. It doesn't do anything that drastic.
<tfeb> Yes, the system is defined, no the system is not loaded
<tfeb> so no code in the system is compiled or executed
<pjb> nij-: quickload does several things. including asdf-load'ing the asd file, which evaluates that form, and this will only record the data structure for the system and its dependencies and components.
<nij-> Now, in my $QUICKLISP/dists/quicklisp/installed/systems/slynk.txt , it does tell quicklisp to look at "dists/quicklisp/software/sly-20210630-git/slynk/slynk.asd"
<nij-> OH.
<pjb> nij-: it's when quickload then tries to compile and load the system that the data structure created by that form will be used by asdf to compile and load the files of its dependencies and its components.
<nij-> How do I ask quickload to enforce loading the file "../contrib/slynk-retro" then?
<pjb> Good question.
<pjb> (ql:quickload :slynk/retro) should have that effect.
<nij-> YES!
<tfeb> does (ql: quickload "slink/retro") work? My guess is not but it might
<tfeb> ... ah
<nij-> YES!!
<pjb> Note that the system "slynk/retro" :depends-on (:slynk) so the system "slynk" will be loaded first.
<nij-> It's weird cuz another system :slynk/mrepl is loaded automatically - https://github.com/joaotavora/sly/blob/master/slynk/slynk.asd#L92
<pjb> The system is _defined_ by loading the asd file, but the system is not _loaded_.
<nij-> And you can see, both systems are defined similarly. Why did :slynk/mrepl get loaded automatically, while :slynk/retro didn't?
<tfeb> some initialization form in slynk (aren't there options saying what extras you want?)
<pjb> not until you ask to load it either thru quicklisp or with (asdf:operate 'asdf:load-op :slynk/mrepl)
bpanthi977 has quit [Remote host closed the connection]
<tfeb> whic, if there are, would be how to get slynk/retro loaded btw
<pjb> You may indeed ask it indirectly by initializing slynk if such a thing is programmed.
tankrim has quit [Ping timeout: 265 seconds]
<pjb> nij-: for this, you would have to read the user manual of slynk.
azimut has quit [Ping timeout: 244 seconds]
<nij-> Opening a fresh-new repl => (ql:quickload :slynk) => (in-package :slynk-mrepl) #|succeed|# => (in-package :slynk-retro) #|error|#.
<hayley> Yes, note you never loaded slynk-retro.
<nij-> But I didn't load slynk-mrepl either.
azimut has joined #commonlisp
<hayley> Maybe there is some other dependency then.
lisp123_ has joined #commonlisp
<nij-> I've searched over the repl, there does not seem to be a form that load slynk-retro for me either.
<pjb> nij-: you're confusing systems and packages.
<pjb> nij-: note that systems are named with lowercase strings "slynk". Packages are named by strings, usually upper-case "SLYNK-MREPL".
<pjb> nij-: it is totally unrelated what package is defined or mutated by loading a system.
<pjb> anything goes.
<nij-> In the repo the package SLYNK-MREPL is given in slynk-mrepl.lisp, which is only pointed by the system :slynk/mrepl.
<nij-> But I have never loaded the system :slynk/mrepl.
<nij-> So the fact that the package SLYNK-MREPL is automatically defined seems weird to me.
<pjb> nij-: for me, (ql:quickload "slynk") (find-package "SLYNK-MREPL") --> NIL
<pjb> nij-: it whatever the slynk system does.
<nij-> That is very very weird.
<pjb> anything can happen, it could as well define a package named "SANTA-CLAUS" or define no package at all.
<pjb> Just look at the sources of slynk!
<pjb> or read the user manual of slynk.
<tfeb> what configuration do you have, because it will be that. I have
<nij-> I'm digging the src of slynk indeed. And cannot see why.
<nij-> tfeb: which config?
hendursa1 has quit [Quit: hendursa1]
<nij-> AH turns out that without quickload-ing slynk gives me the package slynk-mrepl already.
<pjb> I don't observe your behavior, and there's nothing in my slynk sources refering the slynk-mrepl pacakge.
<nij-> I see. It must be that when I loaded sly from emacs, it loaded the mrepl config for me automatically.
<nij-> When I run an sbcl in terminal, it doesn't have that effect.
<tfeb> nij: right: that config
<nij-> It's clear now. Thanks for helping me to clarify.
<pjb> A different one, indeed.
<nij-> :))
hendursaga has joined #commonlisp
<tfeb> Or ~/.slynkrc
<nij-> tfeb I think it's sly.el that's doing the magic xD
<nij-> They want to have mrepl autoloaded I suppose.
<tfeb> Yes, I set up sly and slime to do that but I forget how (but it's not in any lisp-side inits I have in git, and I can't see my emacs-side inits from here)
<nij-> And I'm being extremely lazy on my emacs config.. currently using doom, which automatically does many magics tooo..
peterhil_ has joined #commonlisp
Inline has quit [Quit: Leaving]
tankrim has joined #commonlisp
waleee has joined #commonlisp
Inline has joined #commonlisp
tfeb has quit [Quit: died]
tankrim has quit [Remote host closed the connection]
tankrim has joined #commonlisp
cosimone has joined #commonlisp
Bike has joined #commonlisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
Inline has quit [Quit: Leaving]
silasfox has quit [Ping timeout: 272 seconds]
cosimone has quit [Quit: ERC (IRC client for Emacs 26.1)]
<lisp123_> Is there a way to test if a value is a gensym?
<beach> lisp123_: You can check whether the home package is NIL.
cosimone has joined #commonlisp
<beach> lisp123_: But you can't make sure it was created using GENSYM.
<lisp123_> beach: thanks
<beach> It could have been created using MAKE-SYMBOL, or from UNINTERN of a previously interned symbol.
<beach> Sure.
<lisp123_> Perhaps I should then store gensyms into a global list upon creation and then check against that?
<beach> clhs symbol-package
<beach> That all depends on your reason for wanting such a test.
ldb has joined #commonlisp
<lisp123_> In 'On Lisp', PG suggests one could use genysm as a value for failing a test, if I were to go down that route, I would need to be able to check that the return value was a gensym created during the process and hence a failure
<beach> That's a strange thing to suggest though. Why not signal a condition?
<ldb> "plain lisp" doesn't have condition
<lisp123_> Yeah it seemed strange to me as well. A condition may work, I will have to play around with it
<beach> ldb: What is "plain lisp"?
<ldb> there is a nonexists common subset between LISP1.5, MacLisp, Scheme, Arc...
<beach> And why is that information important to the question from lisp123_?
<ldb> I guess PG trys to avoid features not present in other lisp variants
<pjb> lisp123_: you would keep the reference to the guard value!
<pjb> lisp123_: (let ((eof (gensym))) (eql eof (with-input-from-string (input "") (read input nil eof)))) #| --> t |#
<pjb> lisp123_: you cannot expect some random uninterned symbol!
cosimone has quit [Read error: Connection reset by peer]
<ldb> pjb: I don't get why need gensym for eof here
<pjb> lisp123_: (let ((eof (gensym))) (with-input-from-string (input "#:foo") (let ((foo (read input nil eof))) (list (eql foo eof) (symbol-package foo))))) #| --> (nil nil) |#
<pjb> ldb: because most other values can be read!
<pjb> lisp123_: (let ((eof 42)) (with-input-from-string (input "42") (eql eof (read input nil eof)))) #| --> t |# WRONG!
<ldb> oh, I see, it is read
<pjb> or stored in a data structure etc,.
<pjb> the point of the guard value is to make sure it cannot have been used in the data structure for anything else.
<pjb> Often NIL is enough for this. But sometimes you want something more unique.
<lisp123_> pjb: Oh I see. So we can use gensym to avoid it being read for something else?
<pjb> Yes.
<pjb> We could as well use (let ((eof (cons nil nil))) …) or any other unique object identity.
<lisp123_> And would this be most useful when saving to file and reading it back in?
<pjb> You couldn't read back the same uninterned symbol.
<ldb> you could write it into a fasl file
<lisp123_> pjb: thanks I think I get it
Inline has joined #commonlisp
<pjb> (let ((eof (gensym))) (let ((data (with-output-to-string (out) (prin1 eof out)))) (print data) (let ((obj (with-input-from-string (inp data) (read inp nil eof)))) (list obj (eql eof obj))))) #| "#:g12402" --> (#:g12402 nil) |#
<ldb> but can't guarantee that would have same reference between sessions
cosimone has joined #commonlisp
<pjb> ldb: you wouldn't write an eof guard, you would just truncate the file. But you could write another guard object in some data structure, as long as you keep a reference to it, and ensure its identity is not lost by the serialisation/deserialisation.
<pjb> (let ((empty (gensym))) (let ((data (list 'foo empty 'bar empty))) (let ((*print-circle* t)) (prin1-to-string (cons empty data))))) #| --> "(#1=#:g12410 foo #1# bar #1#)" |#
<pjb> then the empty is serialized here as #1#.
<lisp123_> Do you mean #1#=#:G12410?
<pjb> this is only the initial one, to know which ## is empty. There could be other shared references.
<pjb> (cons empty data)
<pjb> The data is just data.
<lisp123_> Understood
<lisp123_> And the next one would be with #2# etc (just tested)
<lisp123_> Thanks pjb
ldb has quit [Ping timeout: 265 seconds]
ldb has joined #commonlisp
<jcowan> When I need a unique object, I usually use (copy-seq "End of file object"), which is self-documenting but guaranteed unique, even if the compiler merges identical string literals.
sander has quit [Ping timeout: 252 seconds]
sander has joined #commonlisp
<loke[m]> jcowan: Why not #:EOF ?
<jcowan> Less portable to othter Lisps, not all of which have uninterned symbols.
<loke[m]> jcowan: What Lisp is similar enough to CL so as to make it worth it?
<jcowan> You can program in Lisp in any Lisp.
<jcowan> Only the details differ. It's not about portability of code but of my brain.
<loke[m]> Right, but you were talking about compatibility.
<jcowan> Mental compatibility. In Scheme it would be spelled with "string-copy".
CrashTestDummy has joined #commonlisp
<jcowan> This actually isn'tt realistic in Scheme, because Scheme has a distinguished eof-object which you can gett a hold of by calling (eof-object) and can be tested for with (eof-object? obj).
CrashTestDummy3 has quit [Ping timeout: 272 seconds]
<jcowan> It has the advantage of being of a distinguished type. So you could in CL declare a struct and call itts constructor once.
cosimone has quit [Remote host closed the connection]
ldb has quit [Quit: ERC (IRC client for Emacs 27.2)]
shka has joined #commonlisp
voltron has joined #commonlisp
silasfox has joined #commonlisp
voltron has quit [Ping timeout: 240 seconds]
Inline has quit [Quit: Leaving]
lisp123__ has joined #commonlisp
lisp123__ has quit [Client Quit]
lisp123_ has quit [Ping timeout: 265 seconds]
Inline has joined #commonlisp
lad has joined #commonlisp
<phoe> TIL that the reader macro for #\( cannot call READ-DELIMITED-LIST directly but must instead call something that handles the consing dot properly
<phoe> s/directly//
Inline_ has joined #commonlisp
Inline has quit [Killed (NickServ (GHOST command used by Inline_))]
Inline_ is now known as Inline
Inline has quit [Remote host closed the connection]
Inline_ has joined #commonlisp
Inline has joined #commonlisp
silasfox has quit [Ping timeout: 272 seconds]
jgkamat has quit [Quit: ZNC - https://znc.in]
voltron has joined #commonlisp
Bike has quit [Quit: Connection closed]
<pjb> jcowan: copy-seq is also suspicious. Try: (cons 'eof nil) or (list 'eof) as unique tokens.
Bike has joined #commonlisp
<jcowan> What makes it suspicious?
<pjb> I don't remember it in scheme. It's called copy-sequence in emacs lisp. (if you don't require 'cl)
<pjb> nothing in r5rs ressembling copy-seq: https://groups.csail.mit.edu/mac/ftpdir/scheme-reports/r5rs-html/r5rs_14.html#SEC88 there's only string-copy.
<jcowan> String-copy, as I posted above
<pjb> oh right.
jgkamat has joined #commonlisp
pegaso has joined #commonlisp
dsk has joined #commonlisp
frgo_ has joined #commonlisp
voltron has quit [Read error: Connection reset by peer]
frgo has quit [Ping timeout: 250 seconds]
kpoeck has joined #commonlisp
Lycurgus has joined #commonlisp
silasfox has joined #commonlisp
Inline has quit [Quit: Leaving]
peterhil_ has quit [Ping timeout: 272 seconds]
silasfox has quit [Ping timeout: 272 seconds]
Inline_ has quit [Quit: Leaving]
Inline has joined #commonlisp
silasfox has joined #commonlisp
yitzi has joined #commonlisp
lisp123_ has joined #commonlisp
nij- has quit [Quit: Using Circe, the loveliest of all IRC clients]
kakuhen has joined #commonlisp
Lycurgus has quit [Quit: Exeunt]
zos has joined #commonlisp
Inline has quit [Quit: Leaving]
terrorjack has quit [Remote host closed the connection]
terrorjack has joined #commonlisp
Inline has joined #commonlisp
rain3 has quit [Ping timeout: 272 seconds]
kpoeck has quit [Quit: Client closed]
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
attila_lendvai_ has joined #commonlisp
cage has quit [Ping timeout: 240 seconds]
cage has joined #commonlisp
yitzi has quit [Quit: Leaving]
pegaso has quit [Quit: Leaving]
zos has quit [Quit: Leaving]
tyson2 has joined #commonlisp
mrcom has quit [Quit: This computer has gone to sleep]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
Bike has quit [Quit: Connection closed]
Colleen has quit [Read error: Connection reset by peer]
lisp123_ has quit [Remote host closed the connection]
Colleen has joined #commonlisp
tux0r has quit [Ping timeout: 272 seconds]
tux0r has joined #commonlisp
jeosol has quit [Quit: Connection closed]
shka has quit [Ping timeout: 272 seconds]
lisp123_ has joined #commonlisp
Bike has joined #commonlisp
pve has quit [Quit: leaving]
wilfred has joined #commonlisp
lisp123_ has quit [Quit: Leaving...]
frgo_ has quit [Remote host closed the connection]
frgo has joined #commonlisp
tyson2 has quit [Quit: ERC (IRC client for Emacs 27.2)]
psycomic has quit [Ping timeout: 272 seconds]
shka has joined #commonlisp
tfeb has joined #commonlisp
jeosol has joined #commonlisp
selwyn has joined #commonlisp
Melantha has quit [Quit: WeeChat 3.2]
cosimone has joined #commonlisp
gaqwas has quit [Ping timeout: 272 seconds]
tfeb has quit [Quit: died]
tyson2 has joined #commonlisp
silasfox has quit [Ping timeout: 272 seconds]
silasfox has joined #commonlisp
shka has quit [Ping timeout: 252 seconds]
peterhil_ has joined #commonlisp
peterhil_ has quit [Quit: Must not waste too much time here...]
tfeb has joined #commonlisp
tfeb has quit [Quit: died]
peterhil has joined #commonlisp
selwyn has quit [Read error: Connection reset by peer]
pillton has joined #commonlisp
cjb has joined #commonlisp
amb007 has quit [Ping timeout: 276 seconds]
amb007 has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
cosimone has quit [Ping timeout: 250 seconds]
taiju has quit [Ping timeout: 240 seconds]
taiju has joined #commonlisp
vaillancourtmax has joined #commonlisp
akoana has joined #commonlisp
dlowe has joined #commonlisp
Bike has quit [Quit: Connection closed]
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
vaillancourtmax has quit [Ping timeout: 272 seconds]
Qwnavery has joined #commonlisp
igemnace has joined #commonlisp
Bike has joined #commonlisp