jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.5, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
<vms14> atm I see that it's really fun to work with
<phoe> Do you use slime?
<pjb> vms14: then you compile the prototype, and you get a production system.
<nchambers> vms14: me too. i just wrote my first lisp and really enjoyed it
<vms14> I've installed slime with sblc
<nchambers> working on a rewrite + stdlib atm
<vms14> and clisp
<phoe> vms14: good. 50% of all Lisp goodness comes from a proper interactive environment such as slime.
<vms14> I see
<vms14> I was using vi, because I know that vi is part of posix standard
<vms14> so vi will be whenever you have a posix system
<vms14> but I use emacs just because slime
<vms14> I really liked the first time I've tried emacs with elisp, how you have a file and you can directly execute parts of the file
<vms14> I like lisp and I feel I should learn it
<vms14> I've tried quicklisp to install clx, It's failing when it tries to open connection to the display
<vms14> saying something about sockets
<phoe> vms14: what's the error?
<vms14> I'd like to use the ffi
<phoe> Give us the stacktrace.
<phoe> vms14: Lisp and Unix are conflicting concepts. They don't exactly map to each other and the Lisp philosophy is richer than the Unix one.
<phoe> In Unix, everything is a file and therefore a stream of bytes. That's a very primitive concept compared to Lisp's object-oriented and typed system.
nirved is now known as Guest54817
nirved has joined #lisp
equwal has joined #lisp
Lycurgus has joined #lisp
<vms14> let me check
yvy has quit [Read error: Connection reset by peer]
Guest54817 has quit [Ping timeout: 252 seconds]
<vms14> Name service error in "getaddrinfo": 8 (hostname nor servname provided, or not known)
<vms14> [Condition of type SB-BSD-SOCKETS:HOST-NOT-FOUND-ERROR]
<vms14> this is
<vms14> I know a bit of xlib
<vms14> this happens when I try to open the display, Xorg works with sockets in a server-client model
<vms14> btw this is netbsd
<vms14> It seems that the sockets are having a problem to find the host
<vms14> (xlib:open-display nil) ; this is what makes it crash
<vms14> in xlib with C if you put XOpenDisplay(null); it connects to the host machine
<phoe> That's the error message.
<phoe> Could you give us the stacktrace?
<vms14> you mean this?
<vms14> Backtrace:
<vms14> 0: (SB-BSD-SOCKETS::ADDRINFO-ERROR "getaddrinfo" 8)
<vms14> 1: (SB-BSD-SOCKETS:GET-HOST-BY-NAME #<unavailable argument>)
<vms14> 2: (XLIB::OPEN-X-STREAM NIL 0 #<unused argument>)
<phoe> Yes
<vms14> maybe it's my fault to put nil
<vms14> thinking that will be the same as in C
<phoe> Try
<phoe> (xlib:open-default-display)
<phoe> I think NIL is not the argument that XLIB expects there.
<phoe> (xlib:open-default-display) ;=> #<XLIB:DISPLAY :0 (The X.Org Foundation R12001000)>
<phoe> Seems to work on my machine.
<vms14> it works
<vms14> CL-USER> (xlib:open-default-display)
<vms14> #<XLIB:DISPLAY :0 (The Xorg Foundation R11804000)>
<phoe> <3
<vms14> ty xD
<phoe> It lives then
<vms14> I had a lot of problems with libraries and stuff in some programming languages in netbsd
<vms14> so I was expecting the same here
<phoe> Note: I'm not a XLIB person, so I can't provide any sane support for it
<vms14> you did
<vms14> xD
<vms14> thanks a lot man
<vms14> now I know that it was because I'm dumb so no problem
<vms14> btw I still trying to figure why lispers talk so high of this language
<vms14> I know nothing and I guess it's a thing I'll appreciate when I'll understand the language
<vms14> do you use it for real work?
<vms14> what limits has lisp compared to other languages?
<phoe> Limits? What do you mean?
<vms14> idk really, I just want to take some info about lisp
<phoe> It's garbage-collected, so it may have some issues meeting hard real-time requirements
<vms14> I saw that it can compete with C if you write the program with some things in mind
<phoe> Lisp applications are made by bundling the Lisp runtime with each application, so a hello-world app may take multiple megabytes of size (which isn't an issue nowadays)
<phoe> Speed is decent, especially with highly optimized compilers like SBCL
<phoe> Even more if you decide to hand-write the hottest parts of code in assembly (which SBCL allows)
<vms14> the first thing I wanted from lisp is to steal concepts
<phoe> Steal what kinds of concepts?
<vms14> but I guess I'll love it so much so I won't scape
<phoe> Programming languages have been stealing concepts from Lisp since 1960s
<vms14> I wanted to do a shit toy language
<vms14> and someday I found the existence of lisp
kuwze_ has quit [Ping timeout: 256 seconds]
<phoe> oh, that's doable - Lisp is an easy language to implement an interpreter from
<vms14> I saw some paul graham posts
<phoe> s/from/for/
<vms14> specially the beating the averages
<vms14> it was like: Oh man, this is a real fan xD
<phoe> Graham is someone I've recently grown to dislike for that sort of posts
<vms14> but more posts I saw, they say the same
<phoe> https://nl.movim.eu/?blog/phoe%40movim.eu/response2-to-5-reasons-why-why-lisp-games-suffer-cdt2CD
<vms14> also, they say that lisp will change your mind
<vms14> is that real?
themsay has joined #lisp
<phoe> It certainly broadens some horizons, yes
<phoe> Myself I was stuck in the mindset that languages are immutable and you always need to adapt problems to languages, well, perhaps switch a language for a different one
<phoe> And Lisp taught me that it's possible to bend languages to problems in addition to the other way around.
themsay has quit [Read error: Connection reset by peer]
<vms14> this is what I've read in some posts
<vms14> that you adapt the language to the program
<vms14> how many time you have with lisp?
<vms14> I just started, so meh
<vms14> atm I'm comparing the difference between lisp and C in syntax
<vms14> I see that lisp is really fun
<phoe> Time? Hmm
<phoe> I've been doing it for... four years I think
<phoe> And the syntax is absolutely different
<vms14> what books I should read?
<vms14> I need to take a book and stick with it
<phoe> minion: tell vms14 about pcl
<minion> vms14: look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<pjb> vms14: PAIP, LISP.
<phoe> minion: tell vms14 about gentle
<minion> vms14: please see gentle: "Common Lisp: A Gentle Introduction to Symbolic Computation" is a smoother introduction to lisp programming. http://www.cs.cmu.edu/~dst/LispBook/
<vms14> I have the gentle book
<vms14> I'm reading it
<vms14> I like how it's made even for non programmers
<phoe> gentle is for non-programmers, yes.
<vms14> showing boxes and arrows
terminal625_ has joined #lisp
pierpa has joined #lisp
<vms14> and once I've finished that?
terminal625_ has left #lisp [#lisp]
<vms14> what you think about the OnLisp book?
<phoe> On Lisp is an advanced one.
<equwal> You want to have an introductory understanding before that.
<phoe> If anything, try ANSI CL by Graham.
<phoe> But, rather than it, I suggest PCL.
<equwal> (same author as OnLisp)
<vms14> yes, I'll finish the gentle book first
<equwal> Agreed.
<phoe> Or PAIP or Lisp In Small Pieces as suggested by pjb .
<phoe> Or Gentle if you'd like a really gentle introduction.
<vms14> not really
<vms14> XD
<vms14> I have a bit of noob knowledge in C
<phoe> Well then
<phoe> Gentle
<pjb> gentle is nice but I'm not sure if it teaches idiomatic modern lisp.
<phoe> and then PCL
<vms14> just played a bit with Xlib and sockets
<phoe> pjb: it doesn't, that's what PCL is for
<pjb> But gentle is very good for newbies.
<vms14> I need to learn a bit of functional programming too
<vms14> recursion blows my mind
<phoe> Recursion is simple
<phoe> You just need to understand recursion first
<pjb> "The Little Schemer" is good to learn recursion.
<vms14> ok
<vms14> I'll note those books
<pjb> It uses scheme (it was titled "The Little Lisper" before scheme, but since it uses a lisp-1, it was renamed).
<vms14> I was watching the course at mit in youtube
<pjb> sicp
<vms14> the SICP
<vms14> yes
<vms14> but I understood nothing xD
<phoe> SICP lectures are very good.
<vms14> they're using scheme, but I can apply what I see in lisp
<pjb> Actually, the videos were shot at HP, at a private course. But indeed, the teachers were from MIT.
<phoe> As for recursion, the most basic example I can think of is https://plaster.tymoon.eu/view/1035#1035
<phoe> The TRACE call prints the pretty pyramid you see on the bottom.
<equwal> Or length is simpler: (defun len (lst) (if (null lst) 0 (1+ (len (cdr lst)))))
<vms14> I do not understand how are they preserving the value
<phoe> Preserving?
<equwal> There is a call stack.
akoana has joined #lisp
<vms14> the value is getting lower and lower by every recursion it does
<vms14> or bigger
<equwal> The call stack carries the value around, but since you don't explicitly use it (like you would in FORTH) it confuses people.
<pjb> (defun %len (lst res) (if (null lst) res (%len (cdr lst) (1+ res)))) (defun len (lst) (%len lst 0)) (len '(1 2 3 4)) #| --> 4 |#
<equwal> Yay tail recursion.
<phoe> Yep, that's one way to get rid of implicit stack.
<phoe> The value to be returned is explicitly passed as a function argument.
<vms14> So I don't need to care about where goes the value?
themsay has joined #lisp
<vms14> just to rely that this value will be changed
<phoe> You need to - in order to understand it.
<equwal> The call stack is still there, it is just one item long.
<phoe> Later, you can forget it.
<vms14> well, I'll do tests later and I'll understand it sooner or later
marusich has quit [Remote host closed the connection]
<vms14> The value to be returned is explicitly passed as a function argument.
<vms14> ok, that was
<equwal> Read the section in SICP where they go though how the tracing works and the way that the shape of it gives away the tail recursion or lack of it. Eventually you will be able to predict what the traces will look like and you'll be ready to go.
themsay has quit [Read error: Connection reset by peer]
themsay has joined #lisp
<vms14> ok
<vms14> I have the sicp book too xD
<vms14> I've tried this, but not's working
<vms14> (defun oh (x) (if (= x 0) `oh (oh (- x 1))))
<vms14> (oh 3)
<vms14> OH
Essadon has quit [Ping timeout: 268 seconds]
<equwal> lol
<vms14> ah it's working xD
<vms14> (defun oh (x) (if (= x 0) x (oh (- x 1))))
<equwal> Backquotes are shorthand for list quoting. `(x ,y) <-> (list 'x y)
themsay has quit [Ping timeout: 268 seconds]
<vms14> yes, I've thought I'll see the process or something
<vms14> but now I understand that it won't return anything until finished this recursion
<vms14> I need to test more and understand it better
<vms14> I'll look the sicp book
<vms14> thanks a lot for your help
<vms14> specially for the clx issue
<vms14> Now I can try xlib inside lisp
vibs29 has quit [Ping timeout: 240 seconds]
vibs29 has joined #lisp
elderK has quit [Ping timeout: 272 seconds]
Arcaelyx has quit [Quit: Textual IRC Client: www.textualapp.com]
shifty has quit [Ping timeout: 240 seconds]
notzmv has quit [Ping timeout: 240 seconds]
notzmv has joined #lisp
vms14 has quit [Quit: Leaving]
kuwze has joined #lisp
holycow has joined #lisp
robotoad has quit [Ping timeout: 250 seconds]
robotoad_ has joined #lisp
nchambers has quit [Ping timeout: 244 seconds]
nchambers has joined #lisp
robotoad_ has quit [Quit: robotoad_]
arescorpio has joined #lisp
Cymew has joined #lisp
Cymew has quit [Ping timeout: 250 seconds]
emaczen has quit [Ping timeout: 252 seconds]
energizer has left #lisp ["Leaving"]
mrcom has quit [Read error: Connection reset by peer]
orivej has quit [Ping timeout: 240 seconds]
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life has joined #lisp
makomo has quit [Ping timeout: 240 seconds]
holycow has quit [Quit: Lost terminal]
_whitelogger has joined #lisp
lose has joined #lisp
vms14 has joined #lisp
arescorpio has quit [Remote host closed the connection]
pierpal has joined #lisp
nchambers has quit [Quit: WeeChat 2.2]
vms14 has quit [Ping timeout: 246 seconds]
milanj has quit [Quit: This computer has gone to sleep]
pierpa has quit [Quit: Page closed]
jack_rabbit has joined #lisp
rnmhdn has joined #lisp
robotoad has joined #lisp
elderK has joined #lisp
robotoad_ has joined #lisp
robotoad has quit [Ping timeout: 250 seconds]
robotoad_ has quit [Remote host closed the connection]
robotoad has joined #lisp
notzmv has quit [Ping timeout: 268 seconds]
notzmv has joined #lisp
<beach> Good morning everyone!
nchambers has joined #lisp
<asarch> Guten Tag, Herr beach!
<asarch> Wie geht's Ihnen?
<beach> Es geht gut, danke.
<beach> But I don't know why you speak to me in German. That's only my fourth language.
<asarch> Toll!
<asarch> Deutsch ist eine gute Sprache, nicht wahr?
<beach> Sehr gut.
Lycurgus has quit [Quit: Exeunt]
<akoana> laut lachend
<no-defun-allowed> Γεια σου, beach
<beach> Ouch, that's not one of my languages.
<no-defun-allowed> that's greek, "hello, beach"
<beach> I could imagine.
rnmhdn has quit [Ping timeout: 250 seconds]
<no-defun-allowed> i set up xmodmap to switch in and out of greek using alt-space and i realised i have little use for it ):
robotoad has quit [Quit: robotoad]
lose has quit [Ping timeout: 250 seconds]
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]
gravicappa has joined #lisp
Bike has quit [Quit: night]
dddddd has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 246 seconds]
mrcom has joined #lisp
emaczen has joined #lisp
CrazyEddy has quit [Ping timeout: 268 seconds]
<emaczen> Do we call #'cffi:foreign-funcall-pointer just like cffi:foreign-funcall but with a function pointer as the first argument instead of the string name?
asarch has quit [Quit: Leaving]
vlatkoB has joined #lisp
<emaczen> nvm, I was looking at an old manual and it had the function parameter listing
rnmhdn has joined #lisp
lerax has joined #lisp
jack_rabbit has quit [Ping timeout: 252 seconds]
robotoad has joined #lisp
rnmhdn has quit [Ping timeout: 250 seconds]
rippa has joined #lisp
Cymew has joined #lisp
<jcowan> There are about 7000 languages, so nobody speaks more than a vanishingly small fraction of them
<jcowan> How important (widely used, whatever) is ECL as an implementation?
Cymew has quit [Ping timeout: 268 seconds]
<verisimilitude> ECL is one of the big implementations, I think, jcowan.
<verisimilitude> The important thing about programming languages is most of them aren't worth learning, also.
graphene has quit [Remote host closed the connection]
dale has joined #lisp
graphene has joined #lisp
<jcowan> No, I mean human spoken languages
patche has joined #lisp
elfmacs has joined #lisp
<jcowan> they too are dying off fast
<jcowan> about one every two weeks, and the half-life at present is about 80 years (one maximum human lifetime)
<beach> jcowan: You should ask jackdaniel about ECL. He is the current maintainer.
<jcowan> Probably not unbiased then (any more than I am about R7RS)
graphene has quit [Remote host closed the connection]
<beach> What is the reason for your question?
graphene has joined #lisp
graphene has quit [Remote host closed the connection]
<jcowan> How bad would it be if a program ran on SBCL, CMUCL, and CCL, but not ECL. (No, it can't be made portable easily.)
emaczen has quit [Quit: ERC (IRC client for Emacs 26.1)]
<beach> I think CMUCL is less important than ECL.
graphene has joined #lisp
graphene has quit [Remote host closed the connection]
meepdeew has quit [Remote host closed the connection]
graphene has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
<verisimilitude> It would be bad in any case, jcowan.
<verisimilitude> What manner of program is this?
<verisimilitude> As a good baseline, you want to make a list of implementations and try to get something working on at least four or five before you release it.
_whitelogger has quit [Ping timeout: 250 seconds]
_whitelogger has joined #lisp
<jcowan> jackdaniel: trying to PM you, are you available for them?
angavrilov has joined #lisp
<fouric> would someone quickly remind me how to check to see if an object is an instance of the class named by a given symbol
<beach> clhs typep
<fouric> i already found that, tried both (typep 'class obj) and (typep (find-class 'class) obj)
<fouric> )
<fouric> wait, did i reverse the arguments
<no-defun-allowed> (typep instance 'class-name)
<beach> You need to read the page. (typep <object> '<class-name>)
<fouric> ty
<beach> ywlcm
<fouric> just trying to save you screen real estate :)
<fouric> oooooh i see why i was confused
<fouric> i was getting "bad thing to be a type specifier: #<class-name {addr}>"
<fouric> so i read the class-name part and thought that i had the args in the correct positions but was passing in the wrong thing
* fouric will read error messages more carefully next time
<jcowan> I'm surprised that a class object is a type specifier
<jcowan> it breaks the idea that a type specifier is the name of a type, as a class is not its own name
<beach> Where did such an idea come from?
<jackdaniel> jcowan: I will be around in ~8h from now
<jcowan> me, I suppose
<jcowan> ah, okay, ttyt
patche has quit [Ping timeout: 250 seconds]
rnmhdn has quit [Ping timeout: 250 seconds]
slyrus1 has joined #lisp
slyrus has quit [Ping timeout: 250 seconds]
slyrus1 is now known as slyrus
<phoe> Heyyy
<phoe> jcowan: I was surprised to notice the same thing
notzmv has quit [Quit: WeeChat 2.3]
<phoe> Class *objects* are valid type specifiers indeed.
<phoe> And it's the only possible way when you have classes that don't have globally bound names. TYPE-OF instances of such classes have no name to return - so they have to return the class objects.
<phoe> (defclass foo () ()) (defvar *foo* (make-instance 'foo)) (setf (find-class 'foo) nil) (type-of *foo*) ;=> #<class-object>
rnmhdn has joined #lisp
notzmv has joined #lisp
rnmhdn has quit [Ping timeout: 245 seconds]
ggole has joined #lisp
gigetoo has joined #lisp
makomo has joined #lisp
\x01VERSION\x01 is now known as grumble
<splittist> good morning
<phoe> hey splittist
lerax has quit [Remote host closed the connection]
<pjb> jcowan: If you have a CL program that doesn't work on a CL implementation, then it is VERY BAD. Because it means that you are at the mercy of the implementers of the implementations where it works. You are using implementation dependent behavior, and eg. the sbcl implementation changes every month! You are basically playing russian roulette every month with your program!
<pjb> jcowan: now, you can mitigate the problem, by structuring your code into two parts, one module that is 100% conforming, and one module that is implementation dependent. This way, at least the 100% conforming module can run everywhere. Put the core functionality in there.
<pjb> jcowan: notice that there is no type object in CL. Types are not first class objects in CL since they don't exist. Only type specifiers. Notice also that there are multiple type specifiers for a single type. For example: (member 42) and (integer 42 42) specify the same type. Now, clase objects ARE type objects! They're the only ones in CL. class names are type specifiers, but they have a real type object, the class object.
<pjb> objects are valid specifiers for themselves in general.
<pjb> For example a string designer such as NIL designates the string "NIL". The string "NIL" designates the string "NIL itself too!
<pjb> (but then, the string "NIL" too; this should surprise you more!)
<pjb> So, #1="NIL" can designate #2="NIL" and #2="NIL" can designate #1#, or #2#.
akoana has left #lisp ["Leaving"]
<phoe> pjb: you are no longer talking about type specifiers, are you?
<phoe> Because "NIL" is not a type specifier.
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
<pjb> phoe: I was talking about string specifiers!
<beach> He seems to have drifted into designators.
<pjb> Yes.
<pjb> They're the same kind of things.
<beach> Is that so?
<pjb> It's only because there is no actual type object in CL they use the term specifier instead of designator.
<phoe> Designators, yes. I don't think the term "designator" is fully equal to "specifier".
<phoe> Especially since "specifier" is not defined in the CLHS glossary.
<pjb> For example, for classes, there's the notion of class designator, since class objects exist.
<phoe> So when you say specifier, I assume a type specifier, since that's the closest thing defined by CLHS.
<pjb> Note the definitions for type specifier and class designator: both are of the form: "an X that denotes a Y".
<pjb> If two terms have the same definition, then they are the same thing.
<pjb> The only difference, is that in one case, the Y is a first class lisp object, and in the other case, the Y is not.
<phoe> Sure, for classes, but you don't have a string specifier.
<_death> extensional argument about terms denoting extensional concepts
<pjb> phoe: there's no class specifier, there's class designators, like string designators.
<pjb> _death: :-) this is #lisp (cf. topic).
_whitelogger has joined #lisp
<phoe> Hm.
<phoe> I have a generic function that has N mandatory arguments.
<phoe> I have N specializers - either class objects or EQL-specializer objects.
<phoe> I want to get a method that would get called if I called the GF with objects of these classes/specializers.
<phoe> COMPUTE-APPLICABLE-METHODS won't help me because I have classes, not instances of these classes.
<pjb> (find-method (function your-gf) '() specializers)
<phoe> Thanks!
robdog_ has joined #lisp
random-nick has joined #lisp
orivej has joined #lisp
verisimilitude has quit [Remote host closed the connection]
makomo has quit [Ping timeout: 250 seconds]
wigust- has joined #lisp
wigust has quit [Ping timeout: 245 seconds]
rnmhdn has joined #lisp
<phoe> Is there a standard function that will return a copy of a list except for its Nth element being replaced by FOO?
<phoe> (replace-thing '(0 1 2 3 4 5 6) 2 :two) ;=> (0 1 :TWO 3 4 5 6)
notzmv has quit [Ping timeout: 250 seconds]
notzmv has joined #lisp
<phoe> SUBSTITUTE :COUNT 1 with set :START and :END seems to do the thing
<sindan> or copy-list and setq nth
<sindan> setf nth I mean
elfmacs has quit [Ping timeout: 250 seconds]
makomo has joined #lisp
robdog_ has quit [Remote host closed the connection]
v0|d has joined #lisp
mrcom has quit [Read error: Connection reset by peer]
Bike has joined #lisp
robdog_ has joined #lisp
cage_ has joined #lisp
<pjb> phoe: (substitute-if :two (constantly t) '(0 1 2 3 4 5 6) :start 2 :end (1+ 2)) #| --> (0 1 :two 3 4 5 6) |#
<pjb> If you set :start and :end you don't need :count.
shka_ has joined #lisp
<phoe> Is (find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) a valid FIND-METHOD call?
<phoe> I mean, the nested lists?
<phoe> I thought that (find-method #'print-object '() (list (find-class t) (find-class t))) was valid, but surprisingly, the former also works on SBCL.
<shka_> hmmmm
<shka_> phoe: no idea if it is valid, but using find-method with find-class t sounds like you wanted to use other method
<phoe> It's an example.
<phoe> My question is if using nested lists in FIND-METHOD's specializer argument is standard.
<shka_> i have no idea, sorry :(
orivej has quit [Quit: No Ping reply in 180 seconds.]
<Bike> phoe: those lists aren't specializers, so no
<Bike> how the heck did you even run into this
orivej has joined #lisp
<phoe> Bike: writing my PROTEST library allows me to encounter all sorts of weird edge cases
<phoe> including this one that took me half an hour to debug
<phoe> I expected FIND-METHOD to err if invalid specializers were passed to it
<phoe> and, well, it didn't
<Bike> sbcl has some kind of internal "parsing" thing going on, so you can pass (eql foo) and stuff too
<Bike> which i'm pretty sure is not standard
shifty has joined #lisp
nirved has quit [Ping timeout: 252 seconds]
<elderK> Lo all :)
<phoe> heyyy
Essadon has joined #lisp
Essadon has quit [Max SendQ exceeded]
nirved has joined #lisp
Essadon has joined #lisp
akoana has joined #lisp
rnmhdn has quit [Ping timeout: 250 seconds]
orivej has quit [Read error: Connection timed out]
orivej has joined #lisp
Cymew has joined #lisp
yvy has joined #lisp
Cymew has quit [Ping timeout: 268 seconds]
gxt has quit [Quit: WeeChat 2.3]
Inline has quit [Read error: Connection reset by peer]
<phoe> siiigh
<phoe> time to write even more tests
gigetoo has quit [Read error: Connection reset by peer]
Inline has joined #lisp
gigetoo has joined #lisp
Inline has quit [Read error: Connection reset by peer]
Inline has joined #lisp
dddddd has joined #lisp
mrcom has joined #lisp
<pfdietz> The standard does not require FIND-METHOD to signal an error if the specializers are malformed. It does if the specializer list isn't of the proper length, and errorp is true.
<phoe> Huh.
<pfdietz> Having said that, sbcl signalling an error would be good.
<phoe> That's correct, though very counterintuitive to me.
<pfdietz> The standard fails to require all sorts of error checks.
robdog_ has quit [Remote host closed the connection]
Inline has quit [Remote host closed the connection]
<phoe> Hey. I just found a bug in my tests by finding a bug in my library by finding a bug in my tests.
Inline has joined #lisp
DGASAU has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
akoana has left #lisp ["Leaving"]
orivej has quit [Client Quit]
orivej has joined #lisp
notzmv has quit [Ping timeout: 250 seconds]
notzmv has joined #lisp
wxie has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
wxie has quit [Quit: Bye.]
orivej has joined #lisp
<pjb> phoe: there's an errorp optional parameter to find-method.
wxie has joined #lisp
<phoe> pjb: that's not what I am asking.
_whitelogger has joined #lisp
wxie has quit [Quit: Bye.]
wxie has joined #lisp
wxie has quit [Client Quit]
wxie has joined #lisp
<pjb> phoe: it's probably valid: find-method searches then for an EQL specifier with those cons objects. Not found -> NIL. :errorp t -> error.
<phoe> pjb: (eql #<BUILT-IN-CLASS T>) is not equivalent to (#<BUILT-IN-CLASS T>).
graphene has quit [Remote host closed the connection]
<pjb> phoe: But (#<BUILT-IN-CLASS T>) is not #<BUILT-IN-CLASS T>.
<pjb> (find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) is a valid call, you're looking for 2 EQL specializers.
graphene has joined #lisp
<pjb> (find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) #| ERROR: Unknown specializer form (#<built-in-class t>) |#
<phoe> No, I'm not looking for two EQL specializers. There is no EQL in there.
<phoe> I'd use INTERN-EQL-SPECIALIZER if I wanted one.
wxie has quit [Ping timeout: 250 seconds]
<pjb> Oh, sorry, I thought find-method too the plain object, not (eql object).
<pjb> +k
<pjb> So yes, (find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) is not valid.
<pjb> (find-method #'print-object '() (list (list (find-class t)) (list (find-class t)))) #| ERROR: Unknown specializer form (#<built-in-class t>) |#
<pjb> in ccl.
<phoe> Yep - that's exactly my issue. ECL also complains about it.
<pjb> phoe: congratulation, you found a sbcl bug. Post an ISSUE if there's not already one about it! ;-)
<phoe> pjb: done that. (:
yvy has quit [Read error: Connection reset by peer]
pierpal has quit [Remote host closed the connection]
rnmhdn has joined #lisp
DGASAU has quit [Ping timeout: 272 seconds]
themsay has joined #lisp
nirved is now known as Guest19042
Guest19042 has quit [Killed (leguin.freenode.net (Nickname regained by services))]
nirved has joined #lisp
jmercouris has joined #lisp
<jcowan> \
<jmercouris> hi everyone, I'm trying to do something like the following: https://pastebin.com/uArY7zFn
<jmercouris> however, I can't see how to do it without writing a recursive function to traverse the sexp and evaluate whatever sexp has a car of :raw
<jmercouris> let me explain what I'm ultimately trying to do
<jmercouris> I'm trying to generate elisp code, where I can put raw Common Lisp that will evaluate to some value
<_death> backquote?
<jmercouris> any tips?
<phoe> clhs subst
<phoe> (subst "https://foo/bar" '(:RAW URL) '(PROGN (IF T (PRINT (:RAW URL)) (PRINT "false"))) :test #'equal)
<jmercouris> _death: do you care to elaborate?
<phoe> ;=> (PROGN (IF T (PRINT "https://foo/bar") (PRINT "false")))
<jmercouris> phoe: that also works, thanks
<_death> `(elisp code here ,(common lisp code here))
<jmercouris> do you mean backtick?
<jmercouris> ok, is a backquote a backtick?
<jmercouris> ok looked it up, they are the same, I see now what you mean
<_death> backquote is backquote.. that's how it's called in Common Lisp
lose has joined #lisp
<jmercouris> I'm used to the term backtick, I'll have to remember its called backquote in those context, thanks
<jmercouris> s/those/this
<jcowan> These are all nicknames; its internationally standardized name is GRAVE ACCENT.
orivej has quit [Ping timeout: 245 seconds]
<jcowan> pjb: Your argument (like many of your arguments) proves too much. CL programs that use threads or sockets are commonplace. Using a shim library makes them reasonably portable, but you are still "at the mercy of the implementers" in the sense that any or indeed all of them could remove either functionality next week.
<jcowan> There is a difference between non-standardized behavior and undocumented behavior. My author is not proposing to rely on the latter in any way.
<_death> I suppose some elisp syntax won't fit so well.. so you could use CL syntax and use an elisp pprint dispatch table
<jmercouris> _death: I've already encountered some fun issues
<jmercouris> for example, consider quotes
<_death> what about them
<jmercouris> one second
<jmercouris> _death: note how the quotes around false are missing
<jmercouris> must have something to do with the format
<_death> shouldn't use ~A for that.. use PPRINT
<jmercouris> I don't want it to print to the repl though, I just want the out
<jmercouris> I mean string value, sorry
<_death> you know PPRINT takes a stream?
<jmercouris> no I don't for some reason emacs is being beligerent
<jmercouris> it's not showing me the lambda list in the echo area
<jmercouris> time to restart the inferior lisp
<jmercouris> I see the optional stream now
<_death> if you want to generate and pretty print code, you should get to know the pretty printer a bit better.. I recommend the hyperspec and chapter 27 in CLtL2.. perhaps also Waters's Lisp Pointers articles
pierpal has joined #lisp
<jmercouris> ok
<jmercouris> thanks
orivej has joined #lisp
<jmercouris> _death: https://pastebin.com/MB6gTbFA
<jmercouris> obviously a bit problematic as the ((if ... will fail
<jmercouris> should I just manipulate forms to add a progn as a list?
<Bike> (pprint (cons 'progn forms) s), no?
<jmercouris> much simpler than what I was thinking thanks bike
Zaab1t has joined #lisp
<jmercouris> alright, so when I am running my code
<jmercouris> what happens now is all functions are prefixed with the packge (NEXT::FUCNTION-NAME ...)
<jmercouris> is there a way to avoid that? as obviously I want to be calling some elisp, where the next package doesn't exist
<jmercouris> for example `(youtube-dl-url ,url) --> (PROGN ('NEXT::YOUTUBE-DL-URL \"https://next.atlas.engineer/start\"))
Lycurgus has joined #lisp
<jmercouris> sorry, there is a typo in the above
<jmercouris> the true output is (PROGN (NEXT::YOUTUBE-DL-URL
<jmercouris> I would like it to actually bye (PROGN (YOUTUBE-DL-URL
<jmercouris> so that it would call a YOUTUBE-DL-URL elisp function
<phoe> jmercouris: how are you printing your stuff?
<phoe> the output depends on how you print your symbols.
<jmercouris> I am pprint
<jmercouris> ing, as suggested above
Mr-Potter has joined #lisp
<phoe> use a custom pprint dispatch for symbols that prints only its name, not its package.
<jmercouris> :(
<jmercouris> yeah, too convoluted this is just for a blog post
<jmercouris> however, I appreciate knowing that is what I would have to do
<jcowan> Or else (let ((*current-package* (find-package #:next))) (pprint obj))
graphene has quit [Remote host closed the connection]
<jmercouris> jcowan: so hacky lol
<jmercouris> I love it
graphene has joined #lisp
<jcowan> Not really. That is the whole point of dynamic variables
<jcowan> you can rebind them around whatever you want to call that depends on them
<jcowan> that's how various format ~ directives actually work: they rebind one of the printer's variables
<jmercouris> so it is documented that pprint will use *current-package*?
<jmercouris> because if it is, I will take back what I said about it being hacky
<jmercouris> if however it is not documented as such, I stand by my statement
<jmercouris> I guess I am just still too ignorant :\
<phoe> this will only work if you print symbols from *package*
<phoe> if that's what you need, then cool
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life_ is now known as Lord_of_Life
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
orivej_ has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
jmercouris has quit [Remote host closed the connection]
notzmv has quit [Ping timeout: 250 seconds]
<jcowan> clhs 22.1.3.3.1
notzmv has joined #lisp
Cymew has joined #lisp
Cymew has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #lisp
rnmhdn has quit [Ping timeout: 240 seconds]
shrdlu68 has joined #lisp
rnmhdn has joined #lisp
random-nick has quit [Ping timeout: 268 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 240 seconds]
Bike has quit [Quit: leaving]
Josh_2 has joined #lisp
meepdeew has joined #lisp
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]
Josh_2 has joined #lisp
lose has quit [Ping timeout: 250 seconds]
cage_ has quit [Remote host closed the connection]
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
varjag has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
Zaab1t has quit [Quit: bye bye friends]
jack_rabbit has joined #lisp
notzmv has quit [Ping timeout: 272 seconds]
notzmv has joined #lisp
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
Bike has joined #lisp
themsay has quit [Ping timeout: 245 seconds]
ebrasca has quit [Remote host closed the connection]
iovec has quit []
robdog has quit [Ping timeout: 250 seconds]
ggole has quit [Quit: ggole]
random-nick has joined #lisp
Lycurgus has quit [Quit: Exeunt]
pierpal has quit [Ping timeout: 240 seconds]
fortitude has quit [Remote host closed the connection]
kajo has quit [Ping timeout: 264 seconds]
kajo has joined #lisp
verisimilitude has joined #lisp
iovec has joined #lisp
kajo has quit [Ping timeout: 250 seconds]
trebor_dki has joined #lisp
kajo has joined #lisp
nowhere_man has quit [Ping timeout: 252 seconds]
robotoad has quit [Quit: robotoad]
rnmhdn has quit [Ping timeout: 250 seconds]
trebor_dki has quit [Ping timeout: 250 seconds]
khisanth__ has quit [Ping timeout: 244 seconds]
vlatkoB has quit [Remote host closed the connection]
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
yvy has joined #lisp
robotoad has joined #lisp
khisanth__ has joined #lisp
sjl has joined #lisp
elderK has quit [Quit: ZzZzZz]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
notzmv has quit [Ping timeout: 245 seconds]
notzmv has joined #lisp
kajo has quit [Ping timeout: 245 seconds]
buffergn0me has quit [Ping timeout: 250 seconds]
buffergn0me has joined #lisp
teej has joined #lisp
shka_ has quit [Ping timeout: 244 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #lisp
kajo has joined #lisp
gxt has joined #lisp
shrdlu68 has quit [Ping timeout: 246 seconds]
nchambers has quit [Ping timeout: 250 seconds]
vms14 has joined #lisp
orivej_ has quit [Ping timeout: 250 seconds]
vms14 has quit [Remote host closed the connection]
yvy has quit [Read error: Connection reset by peer]
random-nick has quit [Read error: Connection reset by peer]
patche has joined #lisp
<dim> if I (push :pgloader-image *features*) from a file where then I call sb-ext:save-lisp-and-die, should I expect the image built as a result to have #+pgloader-image?
<jackdaniel> dim: yes, doesn't it work like expected?
orivej has joined #lisp
Lycurgus has joined #lisp
orivej has quit [Ping timeout: 250 seconds]
orivej has joined #lisp
<dim> well not really, I will have to do more testing
<dim> basically I want some handler-bind, lparallel:task-handler-bind and handler-case to act differently when in an interactive SLIME session and when in an image, to help me with debug facilities (empty condition handling) and to print something non-interactive when /usr/bin/pgloader is being used by a non CL developer
<dim> seems I'm missing some things here and there still in the new save.lisp that I intend to use instead of buildapp when it's ready
<dim> anyway, time to get off-screen now, I'll see about that tomorrow
<dim> gn!
<jackdaniel> good night \p
Josh_2 has quit [Quit: ERC (IRC client for Emacs 26.1)]
Lycurgus has quit [Quit: Exeunt]
shifty has joined #lisp
Cymew has joined #lisp
Cymew has quit [Ping timeout: 250 seconds]
notzmv has quit [Ping timeout: 250 seconds]
varjag has quit [Ping timeout: 272 seconds]
debsan has quit [Ping timeout: 250 seconds]
sindan has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
<sjl> Is there something like POSITION-IF that would give me a list of ALL positions that satisfy the predicate, instead of just the first?
<sjl> (I can (already have) easily write my own, just wondering if there's something clever built-in I could use)
pierpal has quit [Ping timeout: 246 seconds]
Josh_2 has joined #lisp
<permagreen> I don't think so, but I'm far from an expert
<sjl> I think http://paste.stevelosh.com/8f7bed46c7fb4ca8bf8038741ed6f7e3bb4a6261 is probably good enough for what I need
<sjl> could do some extra work to optimize away the key funcall for identity I guess
<sjl> wait, I can actually just let reduce do that for me