jackdaniel 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> | Pastebin: <https://plaster.tymoon.eu/> | News: ELS'22 this Monday (2022-03-21), see https://european-lisp-symposium.org
random-nick has quit [Ping timeout: 268 seconds]
poselyqualityles has joined #commonlisp
yauhsien has joined #commonlisp
akoana has quit [Quit: leaving]
Andrew is now known as LeetPeet
LeetPeet has quit [Quit: Leaving]
AndrewYu has joined #commonlisp
karlosz has joined #commonlisp
AndrewYu is now known as Andrew
karlosz has quit [Client Quit]
zacque has joined #commonlisp
VincentVega has quit [Ping timeout: 272 seconds]
szkl has quit [Quit: Connection closed for inactivity]
asarch has joined #commonlisp
karlosz has joined #commonlisp
<asarch> How could I "put" the arguments of a function into a variable (e.g.: (format t "Se venden tacos") → (format foo))?
karlosz has quit [Client Quit]
<zacque> If foo = '(t "Se venden tacos"), then you can invoke `format` like (apply #'format foo)
<zacque> You can test it out like: (apply #'format '(t "Se venden tacos"))
<zacque> Or: (let ((foo '(t "Se venden tacos"))) (apply #'format foo))
<zacque> asarch: The result should be what you have in mind
<asarch> Is there a way to do it with a macro (e.g. (format `(,taco)))?
<zacque> Yup, then you simply have to build the require form. More like `(format ,@taco)`
<asarch> How would you declare the macro?
<White_Flame> you shouldn't use a macro where a function suffices
<White_Flame> declare the function inline, if inlining is the major reason
<asarch> ?
<asarch> How would you do it?
<White_Flame> the macro or the function? both would be as zacque already pointed out:
<White_Flame> (defun out (&rest args) (apply #'format args))
<White_Flame> or (defun out (list) (apply #'format list))
<White_Flame> (defmacro out (list) `(format ,@list))
<asarch> format should be out of the macro
<zacque> asarch: What are you trying to do here?
Alfr has quit [Quit: Leaving]
<zacque> What do you mean by "format should be out of the macro"? Can you move it out by yourself?
<asarch> Let's say taco = t "Se venden ~d tacos". I would like to do: (format foo 10) → (format t "Se venden ~d~%" 10)
<asarch> I mean, the macro should be expanded as: (format t "Se venden ~d tacos" 10)
<asarch> The args t and "Se venden ~d tacos" must be inside the foo var so I could easy type: (format foo 10)
<White_Flame> (apply #'format (append taco args))
frgo_ has joined #commonlisp
yauhsien has quit [Ping timeout: 246 seconds]
frgo has quit [Ping timeout: 248 seconds]
ebrasca has joined #commonlisp
pjb has quit [Ping timeout: 240 seconds]
<jmercouris> there's some sort of uiop:write-string-to-file or something
<jmercouris> I can't remember what it is
<jmercouris> I just want to dump a string to a file
Alfr has joined #commonlisp
<jmercouris> sorry, seems it was alexandria
<asarch> (defmacro taco() t "Se venden ~d tacos")
<jmercouris> for anyone curious it is alexandria:write-string-into-file
imjim has joined #commonlisp
prokhor__ has joined #commonlisp
Inline has joined #commonlisp
<asarch> (format `(,(taco)) 10)
<asarch> But t is not expanded
prokhor_ has quit [Ping timeout: 260 seconds]
Inline__ has quit [Ping timeout: 252 seconds]
<zacque> asarch: Can you try pasting your code into a pastebin: https://plaster.tymoon.eu/
<asarch> That's all my code
<asarch> Those two lines
<zacque> Is it two lines or one line?
poselyqualityles has quit [Ping timeout: 268 seconds]
<zacque> Oh
<asarch> 1. (defmacro taco() t "Se venden ~d tacos")
<asarch> 2. (format `(,(taco)) 10)
<imjim> I just ran that in `clisp` and got "FORMAT: The control-string must be a string, not 10"
<asarch> Those two lines should become into: (format t "Se venden ~d tacos" 10)
<zacque> asarch: You can either: (defmacro taco (num) `(format t "Se venden ~d tacos" ,num)) or (defun taco2 (num) (apply #'format (list t "Se venden ~d tacos" num)))
<zacque> As White_Flame said, you are advised to use a function
<zacque> I think you should check out how to write a macro: https://gigamonkeys.com/book/macros-defining-your-own.html
<asarch> Then I could easily write (defun beer(pizza) (format t "Se venden ~d tacos" pizza)) and then I just (beer 10), right?
<asarch> But that's not what I need
<zacque> So, what exactly are you trying to do?
<zacque> You want something like this: (format `(,(taco)) 10)?
<zacque> You can't do that in Common Lisp, it's not the way it works
<zacque> The equivalent way to do that is: (apply #'format (append taco args))
<zacque> It does what you have in mind, but according to rules of the game
<zacque> Here: taco = '(t "Se venden ~d tacos")
<zacque> Maybe you should try it out in a REPL?
<zacque> Maybe the question you should ask is why (format `(,(taco)) 10) works as you think
<zacque> And understanding that question will bring you further
Bike has joined #commonlisp
<asarch> I need something a la C' macros (with arguments and all) so I could write a full mixture of them: (format foo 10 bar baz(10)…) → (format t "Se venden ~d tacos" 10 …)
<asarch> :(
<zacque> How about (apply #'format (append foo 10 bar (baz 10) ...)))?
<zacque> Are you trying to write Lisp or C?
<zacque> Or write C in Lisp?
<zacque> For the later check out: https://github.com/dundalek/awesome-lisp-languages
knusbaum has quit [Ping timeout: 246 seconds]
<zacque> Oh, come to think of that, maybe a symbol macro will help
knusbaum has joined #commonlisp
<pillton> asarch: Macros in common lisp are nothing like C macros. The word macro in common lisp is actually short for macro function. Furthermore, there are actually many types of macros: reader macros, symbol macros and macro functions. Reader macros are executed when forms are being created from a character string or a character stream. Symbol macros and macro functions are expanded or invoked during compilation or evaluation.
knusbaum- has joined #commonlisp
knusbaum- has quit [Remote host closed the connection]
knusbaum has quit [Ping timeout: 272 seconds]
<zacque> hayley: I don't really get what the article is trying to say
<hayley> Nor do I.
<zacque> Lol
<hayley> Sturgeon's law applies to the Lisp family?
<zacque> Like not all programming language with S-exp are Lisp?
<zacque> But there are other arguments in it as well
<hayley> There's no real definition for Lisp, so we can argue all day about what languages are "Lisp" or not. But most are terrible.
<zacque> It only says "not all programming languages with S-exp are Lisp" but didn't say what exactly is Lisp to him/her
<zacque> Agree
<hayley> I don't think I said anything about any languages not being Lisp.
knusbaum has joined #commonlisp
<asarch> Thank you, thank you very much :-)
<hayley> But I guess I am confused as to how we jumped to "Are you trying to write Lisp or C?"
<zacque> My bad, I saw asarch said he wants "something a la C' macros" and in the format example, there is a "baz(10)"
<hayley> Okay.
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
<asarch> #define abs((x)(y)) …
<White_Flame> (defmacro abs (x y) ..)
<hayley> Even if we had the right syntax, say (format foo 10 bar (baz 10) …) I don't see how you get to (format t "Se venden ~d tacos" 10 …), unless we use how the C preprocessor can replace a macro form with zero or multiple forms.
<White_Flame> and shockingly you can just use normal lisp code to generate the expansion, instead of a separate template language ;)
<hayley> And...I guess I am happy that Lisp macros cannot do that.
terrorjack has joined #commonlisp
<zacque> We can using symbol-macros...
knusbaum- has joined #commonlisp
knusbaum has quit [Ping timeout: 256 seconds]
<zacque> Oh, we can't
<asarch> Anyway, have a nice day gentlemen. See you later :-)
asarch has quit [Quit: Leaving]
knusbaum has joined #commonlisp
knusbaum has quit [Client Quit]
knusbaum- has quit [Ping timeout: 268 seconds]
ldb has joined #commonlisp
knusbaum has joined #commonlisp
<beach> Good morning everyone!
<phantomics> Morning beach
<phantomics> Asking this again as more are around: Has anyone ever used the Yale Haskell compiler? It's supposed to be implemented in CL but it appears to use Pseudoscheme, a Scheme implementation compiling to CL which I downloaded but couldn't get working, the build process is obviously very old
<hayley> I might know someone who has.
<hayley> Still, <https://github.com/fiddlerwoaroof/yale-haskell-reboot> looks self-contained and doesn't mention a Pseudoscheme dependency.
<hayley> Or rather <https://github.com/haskell-lisp/yale-haskell> looks like the original repository. Hm.
<phantomics> Oh cool, I didn't find the reboot. The second repo is the original
<phantomics> It's an interesting piece for Lisp archaeologists
waleee has quit [Ping timeout: 260 seconds]
<zacque> Interesting, seems like it's the implementation of Haskell 1.2/1.3?
semz_ has joined #commonlisp
<phantomics> I was thinking it could be neat to build an April-style interface to it so you could invoke Haskell in the middle of CL code
semz has quit [Ping timeout: 260 seconds]
<ldb> phantomics: YHC actually builds on T language, which is a dialect of lisp in the linage of Scheme but more focus on low level
<phantomics> ldb: The repo page says it doesn't work with T
<ldb> Yes at sometime they try to mimic T on lisp/scheme and the compatibility was broken
<phantomics> So they tried to port it from T to CL (or Scheme?) and broke it?
<ldb> They ported it to Common Lisp following an older standard (Lucid Common Lisp), and today's CL is no longer fully compatible with that.
<phantomics> Gotcha, I'll try the fiddlerwoaroof reboot, wonder what it would take to get working again
<ldb> The parser is actually not very good, and besides that it's all about high level code transformations, the runtime is just "lazy eval based on lisp closures".
<phantomics> Right, parsing a vector language is complicated enough
ebrasca has quit [Remote host closed the connection]
Guest74 has joined #commonlisp
Bike has quit [Quit: Connection closed]
<Guest74> surprised nobody mentioned formatter.  But who knows what was trying to be accomplished.
knusbaum has quit [Ping timeout: 248 seconds]
knusbaum has joined #commonlisp
ldb has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
knusbaum has quit [Ping timeout: 246 seconds]
knusbaum has joined #commonlisp
semz_ is now known as semz
triffid has quit [Ping timeout: 240 seconds]
triffid has joined #commonlisp
yauhsien has joined #commonlisp
Andrew has quit [Quit: Leaving]
AndrewYu has joined #commonlisp
knusbaum has quit [Ping timeout: 246 seconds]
knusbaum has joined #commonlisp
lispy has joined #commonlisp
<lispy> hi guys
<lispy> I wrote this function : https://plaster.tymoon.eu/view/3017#3017
<lispy> I keep getting an error on the last progn saying the variable "ELEMENT" is not defined (its supposed to be a plist)
<lispy> If I just remove element it works but I am trying to return it
<lispy> I don't understand what the problem is :\
<lispy> if I give it something self evaluating (like 40) it works, but with the variable element it doesn't
yauhsien has quit [Remote host closed the connection]
AndrewYu has quit [Quit: Leaving]
yauhsien has joined #commonlisp
AndrewYu has joined #commonlisp
hayley has left #commonlisp [#commonlisp]
<beach> I don't get any error like that.
<beach> Oh, you mean when you run it?
tyson2 has quit [Remote host closed the connection]
<beach> The variable ELEMENT is defined. So the error must say something else.
<lispy> weird
<lispy> sec
<lispy> I tried it again and it worked....... i think i maybe had the wrong region shaded and it caused the error, awkward.
<lispy> Thanks.
<beach> Sure.
pfd has joined #commonlisp
yauhsien has quit [Ping timeout: 268 seconds]
<lispy> I guess I am still having a problem with that function but now its a logical problem
<beach> Your code is strange. It looks like in the `then' branch of the IF, you should be able to use T rather than MEMBER-P.
<lispy> if I call "(add-element '(:colored "Red" :price 15))"
<lispy> and then call "(gethash 1 *id-hash-table*)"
<lispy> I get (:COLORED "Red" :PRICE 15)
<lispy> But when I call "(gethash '(COLORED "RED" :PRICE 15) *value-hash-table*" i just get NILs
AndrewYu is now known as Andrew
<lispy> I think its a naming issue, member-p isnt a boolean
pfd has quit [Quit: Client closed]
<beach> Then your code is weird in many other ways.
<lispy> It was when I first wrote the function but I should change it
<lispy> sure, whats the problem
<beach> IF should be given a Boolean as a test, and the variable should not be called MEMBER-P.
<lispy> does it need to be a boolean ? Its either NIL or anything else no ?
<beach> I am not talking about semantics. I am talking about the message you sent to people who read your code, in this case me.
<lispy> Right, what would you suggest I use other than an if here ? if its either nil or some value
<beach> Then I would use (if (null ...) ... ...) and reverse the branches.
<lispy> sure
<lispy> anything else weird or ?
<beach> There is a mysterious blank line between the two IF branches.
<lispy> I have it there for readability
<beach> I am sorry to hear that.
<beach> This is not how Common Lisp code is written.
<beach> If you have it there for readability, then extract each branch to a function, remove the PROGNs.
<lispy> so the expectation is to have the if inline ? like (if () () ) or the issue is the blank line only ?
<beach> The latter.
<lispy> right
<beach> Look at existing Common Lisp code. You see a blank line only between top-level forms.
<lispy> Anything else ?
pfd has joined #commonlisp
<beach> Well, I don't really understand the code, so it is hard to say. I would probably abstract out the explicit hash tables and use a "dictionary"-type interface.
<lispy> hmm
<lispy> I have two hash tables one where the id is the key and the value is the value and another where its the opposite
<lispy> forget the "T" branch for now for the first F
<lispy> if*
<beach> And I would remove the HASH-TABLE part of the names of the special variables.
<lispy> why isnt the NIL Branch saving the value to id hash ?
knusbaum- has joined #commonlisp
<beach> It looks like it is.
knusbaum has quit [Ping timeout: 256 seconds]
<lispy> "(gethash '(COLORED "RED" :PRICE 15) *value-hash-table*" returns 2 NILs :(
<beach> Are you using the right :TEST for your hash tables?
<lispy> im using default, which is EQL
<lispy> should be fine since the lists arent strings no ?
<beach> Try (eql '(COLORED "RED" :PRICE 15) '(COLORED "RED" :PRICE 15))
<lispy> hmm
<lispy> so i need to use equal.. ok
<beach> What makes you think two lists constructed at different times by the reader would be EQL?
<lispy> Im kinda new to lisp, more used to other languages, I don't know what the difference between EQL and equal is exactly
<beach> clhs eql
<beach> clhs equal
<lispy> Yep, reading up on it right now :)
<lispy> Alright, ill try it, thanks.
<beach> Pleasure.
<lispy> Huge, its working, thanks for all the tips but I must go start work now.
<beach> Good luck!
lispy has quit [Quit: Client closed]
hashfunc14a0 has joined #commonlisp
<hashfunc14a0> why is (/ #xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F #x02) giving me 115792089237316195423570985008687907853269984665640564039457584007908834671663/2 ?
<hashfunc14a0> why am i not getting a sane result?
<White_Flame> why isn't it sane? you're giving it precise numbers, it's giving you a lossless/precise result
<aeth> isn't that the exact answer? not going to run it to check if it's a compiler/CPU bug
<White_Flame> clearly it's an odd number, so division by 2 would either yield an imprecise int, or imprecise float
Cymew has joined #commonlisp
<White_Flame> thus a rational is most sane
<aeth> if you don't want the exact answer, you have to tell it how to round. ROUND, TRUNCATE, FLOOR, CEILING. And if you want to turn it into a float, then FROUND, FTRUNCATE, FFLOOR, FCEILING
<aeth> and specifically for powers of two, you can ASH
<aeth> if you want to shift
<White_Flame> or just plain (float *)
<aeth> well, no
<aeth> you'll get different answers if you do FLOAT or COERCE vs if you do it directly... probably a bit less efficient, perhaps with an intermediate bignum/bignum rational if the compiler doesn't expect it.
<aeth> e.g. (coerce (/ #xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F #x02) 'double-float)
<aeth> vs. (fround #xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F (coerce #x02 'double-float))
<aeth> Same answer, but it doesn't have to be. FROUND defaults to single-float unless you specify double-float, so you do have to do some coerce, but nothing that a helper function can't fix
<White_Flame> I meant converting the result to a float
<White_Flame> for display
<White_Flame> but still, I presume a large hex number would be the most desirable for this situation? then round + print in base 16
<White_Flame> hashfunc14a0: if this is the case, recall that the reader simply reads the big hex number as an integer, passing no knowledge that it was in a hex representation originally
karlosz has joined #commonlisp
<hashfunc14a0> White_Flame: aeth: ah ok. thanks ya'll. that makes sense
yauhsien has joined #commonlisp
Josh_2 has joined #commonlisp
<Josh_2> Good morning
<aeth> yes, you'd usually want to manually use FORMAT anyway, so you can get the right amount of leading 0s
<aeth> since it wouldn't know how many to provide for a bignum
<aeth> e.g. (format t "#x~32,'0x" #xff)
<aeth> and half that is (format t "#x~32,'0x" (ash #xff -1))
<jdz> hashfunc14a0: An illustrative question is: what would you expect an answer to the following expression to be: (+ (/ 1 3) (/ 2 3)), which can also be written as (+ 1/3 2/3)?
karlosz has quit [Ping timeout: 256 seconds]
<beach> It would be "interesting" if "sane" were to be defined as "what broken languages like C do".
triffid has quit [Ping timeout: 240 seconds]
triffid has joined #commonlisp
pillton has quit [Remote host closed the connection]
MajorBiscuit has joined #commonlisp
Major_Biscuit has joined #commonlisp
<ck_> not closely related, but I keep wanting to ask this question: where in the clhs, for example http://www.lispworks.com/documentation/HyperSpec/Body/22_cca.htm , does it say that you specify padchar 0 with '0 in the control-string?
Alfr has quit [Quit: Leaving]
MajorBiscuit has quit [Ping timeout: 246 seconds]
<semz> clhs 22.3
<semz> "Prefix parameters are notated as signed (sign is optional) decimal numbers, or as a single-quote followed by a character."
shka has joined #commonlisp
shka has quit [Client Quit]
shka has joined #commonlisp
<ck_> thank you
hashfunc14a0 has quit [Ping timeout: 268 seconds]
Alfr has joined #commonlisp
dec0d3r has quit [Quit: Leaving]
ssafar has quit [Ping timeout: 272 seconds]
pranavats has left #commonlisp [#commonlisp]
Brucio-61 has quit [Ping timeout: 245 seconds]
scymtym has quit [Ping timeout: 268 seconds]
<jackdaniel> stylewarning: is there a table for magicl re the high level interface for which operations are not implemented? i.e multiplication (magicl:@) doesn't have any implementation disregarding the backend (I think)
<stylewarning> jackdaniel: good question, and no I don't think so. It would be pretty easy to programmatically generate one though
<jackdaniel> yeah, I've considered that for a moment but decided that I don't want to peek into the underlying abstraction too much (I have other problems at hand)
<stylewarning> (and it would be quite welcome to get as many operations in :LISP as possible)
<jackdaniel> yeah, that's my impression
<jackdaniel> another brief thought I had was whether defining a gpu backend would be feasible
<stylewarning> I haven't thought about it too much; I think the difficulty would be around managing memory (where it sits when)
<jackdaniel> I see, thanks
<stylewarning> jackdaniel: I suspect a GPU allocator of some sort would need making https://github.com/quil-lang/magicl/blob/master/src/high-level/allocation.lisp
<stylewarning> but again, i'm just spitballing, haven't thought about it much. Was it MGL-MAT where I saw GPU stuff? I don't remember
Brucio-61 has joined #commonlisp
<jackdaniel> oh, I didn't know the word 'spitballing' :)
scymtym has joined #commonlisp
<stylewarning> haha, goofy word for sure
<jackdaniel> no, I like it
<jackdaniel> already internalized ,-)
<jackdaniel> (I was about to say interned)
<stylewarning> haha
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 268 seconds]
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
Dynom has joined #commonlisp
sp has quit [Quit: You have been kicked for being idle]
attila_lendvai has joined #commonlisp
yauhsien has joined #commonlisp
s-liao has joined #commonlisp
pjb has joined #commonlisp
rotateq has joined #commonlisp
ssafar has joined #commonlisp
lisp123 has joined #commonlisp
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
igemnace has quit [Remote host closed the connection]
s-liao has quit [Quit: Client closed]
nature has quit [Ping timeout: 260 seconds]
random-nick has joined #commonlisp
Oddity has quit [Ping timeout: 246 seconds]
Devon has joined #commonlisp
cosimone has quit [Ping timeout: 260 seconds]
tyson2 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
wyrd has quit [Remote host closed the connection]
<Xach> aeth: you should not use that function
wyrd has joined #commonlisp
<Xach> it's not deprecated, it's just fround upon.
s-liao has joined #commonlisp
igemnace has joined #commonlisp
<rotateq> aeth: Which function? Sorry I just joined 2h ago today.
lisp123 has quit [Remote host closed the connection]
<Xach> sorry, just a bad pun
pranavats has joined #commonlisp
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
Bike has joined #commonlisp
<rotateq> yes okay, no worries
semz has quit [Quit: Leaving]
<pjb> zacque: it's not clear what you're really asking with respect to the macros. You have two cases: 1- you have a macro moo that takes a few arguments, and you want to write the values of those arguments in a list. 2- you have a macro moo that has the arguments to a function in a list, and you want to build an expansion form containing a function call to foo with those arguments (and perhaps a few more).
<pjb> there's a case 2bis- where the macro moo expand to a macro muu instead of a function foo; both cases 2 and 2bis are really identical.
<pjb> zacque: in the case 1- the answer is no. Unless it's really a case 2bis. The reason why is because the arguments to a macro must be known at compilation-time (macroexpansion-time), but if you store them in a variable, that is, a run-time variable, the value of that variable (the list of the arguments) is not known at compilation-time (macroexpansion-time).
<pjb> zacque: the case 2- and 2bis- as indicated involve building a list, and you can do that with various list operators, with elements stored in various variables or literal lists. (append (list 'format) arguments '(and some more) final-arguments) or using backquote to help you write those expression: `(format ,@arguments and some more ,@final-arguments)
<zacque> pjb: Ah, there is a misunderstanding here. It's @asarch who is asking the question: https://irclog.tymoon.eu/libera/%23commonlisp?around=1649293770#1649293770
<pjb> Oops, sorry.
yauhsien has quit [Remote host closed the connection]
<pjb> I misread the exchange.
<zacque> No problem, I'm reading your explanation as well
yauhsien has joined #commonlisp
<zacque> Perhaps I can learn one or two things from it
mon_aaraj has quit [Ping timeout: 246 seconds]
cosimone has joined #commonlisp
mon_aaraj has joined #commonlisp
treflip has joined #commonlisp
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
<zacque> That's a well thought-out explanation. As for case 1, I think that's when one should define a function to do the job
<zacque> I don't get the case 2bis: "where the macro moo expand to a macro muu instead of a function foo"
<zacque> What is the macro muu in mind here?
<zacque> @pjb
Bike has quit [Quit: Connection closed]
Bike has joined #commonlisp
s-liao has quit [Ping timeout: 250 seconds]
yauhsien has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
rotateq has quit [Read error: Connection reset by peer]
<Josh_2> If I have a class that has two superclasses and there is an :after methods for both of those superclasses are they both called?
<Josh_2> hmmmm
zacque has quit [Quit: Goodbye :D]
<Josh_2> hmmm seems none of them are being called :sob:
mon_aaraj has quit [Ping timeout: 272 seconds]
mon_aaraj has joined #commonlisp
livoreno has joined #commonlisp
<Bike> they should both be called
<Josh_2> hmmmm
<Josh_2> Okay
<Bike> you can use compute-applicable-methods to make sure the methods you expect to be called will be called
<Josh_2> Okay I'll check
<Josh_2> hmmm
<Josh_2> only (make-instance (symbol)) was returned
<Josh_2> But I have make-instance :after for both of the superclasses
igemnace has quit [Remote host closed the connection]
<Bike> make-instance is specialized on the class of the class, not the class itself
<Josh_2> ahh
<Bike> like, if you have (defclass foo () ()), and do (make-instance 'foo), that will become (make-instance (find-class 'foo)), which will go to the method on standard-class or the like
<Josh_2> What about initialize-instance?
<Josh_2> I see
<Bike> initialize-instance is probably what you want, though depending on what you're doing it might be shared-initialize instead
<Josh_2> I want to add functionality for various common slots, like ID's, automatically adding expire timestamps etc
Cymew has quit [Ping timeout: 246 seconds]
<Bike> it is not obvious to me what that would entail
<Josh_2> Well I was trying to just use make-instance :after to automatically add the ID's
<Josh_2> I will try initialize-instance
s-liao has joined #commonlisp
<Bike> that sounds more like an initialize-instance thing indeed
<Josh_2> Okay that worked thanks :)
<Bike> glad to help
azimut_ has quit [Remote host closed the connection]
azimut has joined #commonlisp
triffid has quit [Remote host closed the connection]
<pjb> zacque: for example: (defmacro moo (arguments) `(let ((and 42) (some 1)) (muu ,@arguments and some))) (macroexpand-1 '(moo (t "Se vende tacos"))) #| --> (let ((and 42) (some 1)) (muu t "Se vende tacos" and some)) ; t |#
<Josh_2> Thanks
<Josh_2> The problem was I was using make-instance
<pjb> Yes, in general, don't override make-instance. There are initialize-instance and shared-initialize (and reinitialize-instance). shared-initialize should probably be used more often, but it's only useful when you use change-class.
igemnace has joined #commonlisp
mon_aaraj has quit [Ping timeout: 248 seconds]
mon_aaraj has joined #commonlisp
s-liao has quit [Quit: Client closed]
yauhsien has joined #commonlisp
wmblathers has quit [Quit: Leaving...]
sander has joined #commonlisp
wmblathers has joined #commonlisp
cage has joined #commonlisp
cosimone has quit [Remote host closed the connection]
waleee has joined #commonlisp
semz has joined #commonlisp
tane has joined #commonlisp
tane has joined #commonlisp
tane has quit [Changing host]
<Fade> ACM opening the first 50 years of their backfiles.
ssafar has quit [Ping timeout: 256 seconds]
ssafar has joined #commonlisp
livoreno has quit [Ping timeout: 248 seconds]
VictorCarvalho[m has quit [Quit: You have been kicked for being idle]
yauhsien has quit [Remote host closed the connection]
yauhsien has joined #commonlisp
epolanski has joined #commonlisp
yauhsien has quit [Ping timeout: 246 seconds]
cosimone has joined #commonlisp
<Guest74> what are some alternatives to emacs-hooks that provide the same functionality?
<Guest74> I never see anybody use that hook library for cl.
<Fade> common lisp typically uses method combinarions in CLOS.
<Guest74> My current situation is I'm writing a simple project/system manager and it would seem to be nice to allow people to configure what happens when a new system is created or you switch to another project.
<Fade> you're doing this in common lisp?
<Guest74> this is #commonlisp
<Fade> my glasses have seen better days. :)
<beach> Guest74: How could emacs-hooks be used for Common Lisp if it is an Emacs library?
<Guest74> emacs like hooks.  There seems to be one library to provide such functionality.
yauhsien has joined #commonlisp
<beach> Ah!
<Fade> I'm a bit confused by the question... but I _think_ if I had that brief, i'd define a generic function protocol around a project object.
<beach> Yeah, sounds right.
<yitzi> Guest74: which library? Just curious.
<Guest74> removing hooks is a lot easier than removing methods.
<beach> Oh?
<Guest74> yitzi: I can't recall, but i'd take a wild guess it's cl-hooks.
<beach> And why would you remove methods?
<Guest74> for the same reason you'd remove a hook no?  don't currently need the functionality.
<beach> Guest74: These days, we tend to design many libraries so that the generic functions take a CLIENT parameter. Client code supplies an instance of a standard class, and client code can also supply methods specialized to its client classes?
<beach> Guest74: I don't know about hooks, but that's not what you do with generic functions. You just make sure the right methods are applicable in the right situation.
<Guest74> well, i'm not too familiar with hooks myself.  But they appear to be simple for people to understand judging by the amount of emacs customization that happens.
<beach> I think it might be the case that hooks are popular in Emacs because Emacs Lisp does not have a full CLOS implementation. I may be wrong of course.
<Fade> EIEIO is close, but it's a recent addition.
<yitzi> Personally, I would think that a hook style interface would be better for something that is dynamically changed like `*debugger-hook*`. Designing an extensible system on top hooks versus using generics/methods seems kind of crazy. Seems like it would end up being spaghetti code.
<Guest74> I may be wrong but asking someone to add/remove methods to customize a project manager might limit the userbase.
<Shinmera> just provide a convenience function to do it then lmao
<beach> Guest74: Which is why I told you how it is done instead.
tane has quit [Quit: Leaving]
<beach> Anyway, good luck!
<Guest74> Shinmera: that would be my point.  If i'm papering over an  interface what would be the benefit over using symtym's library?
<Shinmera> because it's one function. c'mon.
<Guest74> beach:just saying use clos is
<White_Flame> ASDF has a pretty large userbase, and asks them to add/remove methods to customize it past the initial grammar
<Guest74> ...past the initial grammar.
<Guest74> out of a userbase of programmers?
<White_Flame> well, apparently that's another hidden requirement not revealed until now?
<scymtym> if i recall correctly, ASDF is a bit special because methods are specialized to systems via EQL-specializers
<White_Flame> or is "project/system manager" not talking about a codebase?
<scymtym> s/methods/generic functions/
<Guest74> nah, any project.
<Guest74> code being just one type of project.
<Fade> cl-hooks seems to do things exactly how it sounds like you wnat to do them...
<Fade> so, problem solved?
<Fade> my own intuition is that I would set up a generic function protocol around a project object, though, and I think you'd find that most lisp programmers would do it that way as well.
<Guest74> I'm not talking about writing the system, just customizing it by users.
<Fade> I'd provide a 'defuserproject macro for that case.
<Fade> unless you're defining a non-sexp configuration language for the system, at which point everything is 100% open in your control.
attila_lendvai has quit [Ping timeout: 256 seconds]
Guest74 has quit [Ping timeout: 246 seconds]
Guest74 has joined #commonlisp
aartaka has quit [Ping timeout: 248 seconds]
aartaka has joined #commonlisp
<Fade> now that I look at the code for cl-hooks, it looks like scymtym implemented it as a generic function protocol
<Fade> ymmv :D
minion has quit [Read error: Connection reset by peer]
specbot has quit [Remote host closed the connection]
agrosant has quit [Ping timeout: 272 seconds]
minion has joined #commonlisp
<Guest74> Perhaps if I said, What do people think about different methods of user customization(not necessarily programmers) of lisp software. cl-hooks being one example, what are the other prevailing methods and their pros and cons.  and hopefully 'just use clos' wouldn't be an answer, since that's what cl-hooks does
specbot has joined #commonlisp
<White_Flame> that's an infinite space of possibility, IMO
<White_Flame> and extremely contextual to any given project
random-nick has quit [Changing host]
random-nick has joined #commonlisp
<Fade> ok..
shka has quit [Quit: Konversation terminated!]
<Guest74> White_Flame: should it be extremely contextual? Seems like there'd be a lot of similarity.
<White_Flame> what the customization is, how deep it is, how low/high level it's specified, how complex it needs to be, what its complexity is vs the complexity of using the program, etc, all factor into exactly how the customizations are expressed
cosimone has quit [Remote host closed the connection]
<White_Flame> "customize" could literally mean anything, including adding new novel features to a program
<Guest74> I think I haven't really seen any user customizable cl software because most stuff isn't user usable.
<White_Flame> or changing a single color
shka has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<White_Flame> most public cl software is tools and libraries
<Guest74> allowing customization at the programmer level is easy.  There should be easy ways for users to say when there's a new A, do b.  ...or I'm just daft for thinking about actual users.
<White_Flame> code has architecture and flow. asking it to do things that it wasn't designed around isn't always easy to inject
<White_Flame> but, a programmer can customize anything; it just varies in how long & difficult that is. some things require full refactoring
<boigahs> I am struggling to think of many end user programs that provide such functionality in a way that isnt "programming" to begin with
<Guest74> every x11 program is customizable.
<White_Flame> really? so I can customize my x11 libreoffice calc to automatically send messages on certain conditions to my email client just because it also uses x11?
<White_Flame> I think you might have some very narrow specific customizations you're looking at, which is fine, but is not what you're specifically communicating
<Guest74> there are different levels of customization.
<Guest74> just because there are different types of customizations doesn't meant that there isn't an ergonomic way to express each type.
<White_Flame> yeah, but at some point an overarching view of everything gets too hand-wavey. I'm not sure I can contribute anything
<White_Flame> conversationally
<Guest74> In an ideal world I'd have an OS where any of it's behaviour could be customized at any level.  with an ease to discover what is customizable and how.
poselyqualityles has joined #commonlisp
<Guest74> and since we're not stuck with any baggage, it would be nice to have some thoughts of how things could work.
<Guest74> but, i'm probably to far in the future.
<White_Flame> note that you're assuming a precondition of existing customizations intentionally exposed by the developer, in foresight of what users might want to customize, as opposed to generally extensible constructs that are used to build systems.
<White_Flame> I would consider the former to be extremely constraining, and the latter to have far more advantages
<Guest74> no, you're assuming that.
<White_Flame> "discover what is customizable and how"
Major_Biscuit has quit [Ping timeout: 240 seconds]
<White_Flame> that does, at least to my reading, imply a specific finiteness
<Guest74> at all levels means you would design the program to be customizable by a programmer in the usual cl way.
<Guest74> it just doesn't exclude customization of simple things, which most people are interested in.
aartaka has quit [Read error: Connection reset by peer]
aartaka has joined #commonlisp
<White_Flame> "Design the program to be customizable" is still intentional programmer workload for specific things in foresight of user customizability desire?
<White_Flame> CL's model is that pretty much everything is accessible, but complex programs generally always require complex understanding of it when changing many things
<Guest74> sure, no problem with that.  Those are the things customizable at the programmer level that is fun for programmers to do.  Doesn't mean we shouldn't have simple protocols for customization for apps to engage in.  I'm thinking it's not to far in the future when we'll have less libraries and more apps being made.
<White_Flame> tools are generally more useful than applications, IMO
<White_Flame> tools are composable, applications are not
<Guest74> that's an assumption.
frgo_ has quit []
<jackdaniel> I've recently tried to compose my hammer with an axe, but it only worked to the point of chopping the shaft
ec has joined #commonlisp
<Guest74> they compsed fine in the middle ages.
<Guest74> composed
<White_Flame> it's kind of definitional. A tool does part of the work, while an application is a collection of specific features usually without much interconnection
<Guest74> maybe that definition of 'app' isn't good for cl.
<White_Flame> to other applications/tools
<White_Flame> right, CL's model is for coders
<White_Flame> creating specific applications that only cater to users of them doesn't expose much of CL's strengths
<White_Flame> the strenths apply to the programmers
<Guest74> again, there isn't any reason why simple things shouldn't be customizable by simple lay people.
<White_Flame> and that's a completely different issue than just "customizations"
<White_Flame> what's an example of a simple customzation that you're thinking of?
<Guest74> and still allow programmers to do what they want.  e.g.  you can customize how a ui looks by a simple plist
<White_Flame> "how a ui looks" is at the scope of full html/css :-P
<Guest74> and yet it can be as simple as (:background "purple")
<White_Flame> background of what element? etc
<White_Flame> regardless of if it's customization or core features, getting a non-technical "user" a presentation & editing system that they can find "easy" is a challenging task
<White_Flame> and it's not a technical problem, but a UX/communicative & complexity management problem
<Guest74> at the total newb level there would be just installation of someone elses customizations.
<Guest74> some people like to design themes.  some people just like themes. some don't care.
<White_Flame> see, now you've segmented "users" into those with capability to edit themes, and those that aren't
<White_Flame> so various features/data/etc aren't just global to "users" in general
<White_Flame> and "programmers" are one of those subsets
<White_Flame> handwaving it all together into "easy customization" simply doesn't work in practice
<Guest74> everything is available if you want to learn how to change it.  But why would a person who doesn't like themes need to create a theme instead of just installing one?
<White_Flame> and what's easy for theme editors isn't easy at all to non-theme-editors, exactly in the same way as programmer-oriented customizations
<Guest74> you're the one that keeps handwaving it into one pile.  I'm saying people customize at different levels and we should probably have some basic protocols to engage in such customization.
<White_Flame> I'm saying the protocols themselves are specific to different audiences & assumptions about their capabilities
<jackdaniel> isn't code the ultimate top for customizing applications (or tools, whatever)?
<Guest74> anyways, ui isn't a concern.  simple gui app for customization or css like sexps.  The main thing about this whole thing was customization of when events occur.
<jackdaniel> you need to know who is the audience, code is a piece of trash for person who doesn't program
<Guest74> jd: i usually think so.  But maybe there's something better for specific situations?
<jackdaniel> and gui point-and-click is garbage for people who'd rather manipulate with waving hands
aartaka has quit [Ping timeout: 272 seconds]
<Guest74> that's not the problem as I've already said both are accounted for.
<Guest74> well, all three, since you could just use the repl.
<jackdaniel> my point is that you may have any number of possible audiences, so "accounting for everyone" is just silly
aartaka has joined #commonlisp
<Guest74> definitely not silly.  Why shouldn't a user system have something for everyone?
<White_Flame> it should, but it require AI to fully grok the user's desires
<jackdaniel> because combinatorically speaking such applicatin would not fit in a system memory?
<White_Flame> no matter what customizations you manually expose as a developer, you will not cover all desired customizations
<jackdaniel> you can't account for every possible person even if you are in person trying to assist them
<Guest74> how much things do you think need to be customized???
<jackdaniel> (ignoring that you would not have time to do that, say you may quickly mutliply)
<jackdaniel> the answer is simple! it depends on whom do you target
<Guest74> All of your code is available to customize.  Having some simple protocols to engage in customization behaviour will not be the end of the world.
<jackdaniel> sure, but it won't cover "all possible audiences"
<White_Flame> Guest74: well, clearly you're only talking about "simple customizations", but appear to want the same sort of tooling for all customization
<jackdaniel> even not "all three"
<Guest74> and what's the difficulty for having an extensible protocol for when somebody discovers a new way to customize something?
<Guest74> White_Flame: where do you get that idea when I keep saying the opposite???
<jackdaniel> I don't think that anyone negates extensible protocols, but limiting the scope is like providing a grammar for your language - if you don't then it is meaningless
<jackdaniel> here: (defgeneric handle (arg &rest args))
<jackdaniel> generally customizable protocol
orestarod has joined #commonlisp
<jackdaniel> (handle may use rest args to dispatch further, it is up to you luke)
aeth has quit [Ping timeout: 272 seconds]
<Guest74> i don't understand why you're so facetious.
<White_Flame> Guest74: sorry, I haven't seen "the opposite". IMO you're communicating a small slice of what you're thinking and it's up to others to fill in the rest
aartaka has quit [Ping timeout: 240 seconds]
<jackdaniel> I'm trying to come through and clearly failing
aartaka has joined #commonlisp
aeth has joined #commonlisp
<jackdaniel> also I'm having so much fun with multiplying matrices that I'm in a facetious mood ,)
<Guest74> White_Flame: You've been running with what you thought I said for so long you can't see it.  I'm clearly not talking about the same tooling when I specifically mention a gui app, css like, and repl.  Nor when I say that there are different types of customization and maybe we can come up with ergonomic solutions for some of them.
<Guest74> anyways, it seems user customization is not important here.  How do you change the theme in mcclim?
<jackdaniel> http://turtleware.eu/static/paste/b7ac7f78-tran.webm - the scaling motion is encoded as a matrix that is applied to the coordinate
<jackdaniel> (I'm using a matrix here that is transformation/dt, so we use ordinary scaling transformation to do it in time)
<jackdaniel> re changing themes: you need to write a frame manager that dispatches make-pane to your own class
<jackdaniel> and your own class has handle-repaint method defined
<jackdaniel> more or less
<jackdaniel> (quite tedious, not really theming but rather implementing look and feel)
<jackdaniel> on this video I'm stepping time by .1 between [1, 1.5]
aartaka has quit [Ping timeout: 256 seconds]
aartaka has joined #commonlisp
<Guest74> jackdaniel: are you allowing 3d transforms?  I've been thinking they'd be useful for eye candy ui stuff.
<yitzi> Is it possible to use RENAME-FILE to rename to a pathname with no type. It appears that NIL pathname components are defaulted from the original path, i.e. `(rename-file #P"fu.bar" #P"fu")` I feel like I am missing something simple.
<Xach> yitzi: (rename-file "fu.bar" (make-pathname :name "fu" :type :unspecific))
aartaka has quit [Ping timeout: 256 seconds]
<yitzi> Xach: thanks!
aartaka has joined #commonlisp
<Xach> In this case, you could get away with (make-pathname :type :unspecific) as it defaults to the name of the original file.
<yitzi> Yeah, my example was a bit simpler than what I am trying to, but I get what you are saying.
<Xach> i think gail zacharias taught me that trick
<yitzi> Cool. Now it's gail -> Xach -> yitzi.
Oddity has joined #commonlisp
<jackdaniel> Guest74: no, transformations in clim are 2d
<jackdaniel> you can of course use your own transformations on coordinates before drawing
<Guest74> I just thought it would be an easy way for handling animations in my compositor.
mon_aaraj has quit [Ping timeout: 248 seconds]
epolanski has quit [Quit: Connection closed for inactivity]
<jackdaniel> how so?
mon_aaraj has joined #commonlisp
yauhsien has quit [Remote host closed the connection]
<Guest74> besides just the regular 2d shrinking and growing stuff, can stack things in 3d, or have circular menus that rotate into the screen.  Useless eye candy stuff.
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 248 seconds]
poselyqualityles has quit [Ping timeout: 248 seconds]
mon_aaraj has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
tyson2 has joined #commonlisp
pfd has quit [Quit: Client closed]
snits has quit [Ping timeout: 248 seconds]
snits has joined #commonlisp
pfd has joined #commonlisp
treflip has quit [Remote host closed the connection]
ivan_wagner has joined #commonlisp
ivan_wagner has left #commonlisp [#commonlisp]
yauhsien has joined #commonlisp
yauhsien has quit [Ping timeout: 256 seconds]
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 268 seconds]
Lord_of_Life_ is now known as Lord_of_Life
pranavats has left #commonlisp [Error from remote client]
Brucio-61 has quit [Ping timeout: 248 seconds]
scymtym has quit [Ping timeout: 260 seconds]
lucie22 has joined #commonlisp
pranavats has joined #commonlisp
Guest74 has quit [Quit: Connection closed]
lucie22 has quit [Client Quit]
Dynom has quit [Quit: WeeChat 3.5]
mon_aaraj has quit [Ping timeout: 248 seconds]
rgherdt has joined #commonlisp
lisp123 has joined #commonlisp
mon_aaraj has joined #commonlisp
Brucio-61 has joined #commonlisp
dirtcastle has quit [Ping timeout: 240 seconds]
Brucio-61 has quit [Ping timeout: 246 seconds]
lisp123 has quit [Remote host closed the connection]
dirtcastle has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Read error: Connection reset by peer]
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 256 seconds]
yauhsien has joined #commonlisp
mon_aaraj has quit [Ping timeout: 256 seconds]
yauhsien has quit [Ping timeout: 268 seconds]
mon_aaraj has joined #commonlisp
cage has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
scymtym has joined #commonlisp
Brucio-61 has joined #commonlisp
Brucio-61 has quit [Ping timeout: 248 seconds]
lisp123 has quit [Ping timeout: 260 seconds]
tyson2 has quit [Remote host closed the connection]
Brucio-61 has joined #commonlisp
wyrd has quit [Ping timeout: 240 seconds]
trumae has joined #commonlisp
wyrd has joined #commonlisp
eddof13 has joined #commonlisp
cosimone has joined #commonlisp
eddof13 has quit [Client Quit]
piethesailor has joined #commonlisp
poselyqualityles has joined #commonlisp
shka has quit [Ping timeout: 248 seconds]
ldb has joined #commonlisp
miique has joined #commonlisp
miique has quit [Remote host closed the connection]
orestarod has quit [Ping timeout: 260 seconds]
attila_lendvai has joined #commonlisp
tyson2 has joined #commonlisp
trumae has quit [Ping timeout: 248 seconds]
ldb has quit [Ping timeout: 272 seconds]
ldb has joined #commonlisp
pillton has joined #commonlisp
pillton has quit [Remote host closed the connection]
<Devon> Emacs-Lisp has "text properties" to colorize, fontify, etc., how is this done in Common-Lisp?
<ldb> Depends on whether you are outputing to a CLIM stream or ANSI terminal
<ldb> apparently the only thing you can have on terminal is ANSI escape sequence
<ldb> but for CLIM, text style is the similar concept to the Emacs face
ebrasca has joined #commonlisp
ldb has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
poselyqualityles has quit [Ping timeout: 272 seconds]
pfd has quit [Ping timeout: 250 seconds]
Brucio-61 has quit [Remote host closed the connection]
Brucio-61 has joined #commonlisp
random-nick has quit [Ping timeout: 272 seconds]
Brucio-61 has quit [Ping timeout: 268 seconds]
pillton has joined #commonlisp
attila_lendvai has quit [Ping timeout: 272 seconds]
yauhsien has joined #commonlisp
Brucio-61 has joined #commonlisp
<pjb> Devon: on an ANSI terminal you can use com.informatimago.common-lisp.cesarum.ecma048
<pjb> Devon: there also exist another ECMA048 system.
yauhsien has quit [Remote host closed the connection]
<pjb> cl-ecma-48 in quicklisp.
<pjb> Devon: alsos, hemlock may have something similar to emacs.
<pjb> s/sos/so/
yauhsien has joined #commonlisp
Oddity has quit [Ping timeout: 248 seconds]
yauhsien has quit [Ping timeout: 256 seconds]
Guest74 has joined #commonlisp
ec has quit [Quit: ec]
tyson2 has quit [Remote host closed the connection]