atgreen has joined #commonlisp
green__ has quit [Ping timeout: 268 seconds]
Lycurgus has joined #commonlisp
random-nick has quit [Ping timeout: 272 seconds]
Nilby has quit [Ping timeout: 258 seconds]
gigamonk` has quit [Ping timeout: 258 seconds]
killsushi has quit [Ping timeout: 272 seconds]
wheelsucker has quit [Quit: ERC (IRC client for Emacs 27.2)]
atgreen has quit [Ping timeout: 268 seconds]
wheelsucker has joined #commonlisp
derelict has quit [Ping timeout: 250 seconds]
energizer has joined #commonlisp
kakuhen has quit [Quit: Leaving...]
derelict has joined #commonlisp
<energizer> Hi I'm not a commonlisper but I have a question about how dispatch works, and hoping someone can answer or point me to the right documentation. In languages with traits/typeclasses, there is a question of which method to pick for (f x) when x has multiple traits that each implement f in a different way. For example, a ContiguousArray might have one method and a RowOrientedArray might have another. How do you pick which method? I'm asking here
<energizer> specifically because I heard CLOS has some unique dispatch features.
kakuhen has joined #commonlisp
atgreen has joined #commonlisp
<White_Flame> methods are not on classes in CLOS
tyson2 has quit [Remote host closed the connection]
<White_Flame> they dispatch based on any number of parameter classes
<White_Flame> so you don't, for instance, have the issue of (collide <ball> <wall>) and have to mandate it exists one one or the other
karlosz has quit [Quit: karlosz]
<White_Flame> the generic function just exists and dispatches on both parameters' types, in that case
<White_Flame> erm, s/types/classes/, as that's important in CL
<kakuhen> there are some edge cases where the multiple dispatch gives you problems, but I've only ran into it when I create a method that dispatches on subclasses of a specific class
<kakuhen> like it'd call a method, but not the one you'd think -- there's a weird preference order that goes on
<White_Flame> resolving which method to call is also completely overridable in CLOS, as is much of the object system itself
<White_Flame> eg the actual method resolution algorithm itself
<pjb> energizer: see compute-applicable-methods
wheelsucker has left #commonlisp [ERC (IRC client for Emacs 27.2)]
froggey has quit [Ping timeout: 258 seconds]
waleee has quit [Ping timeout: 250 seconds]
karlosz has joined #commonlisp
<energizer> thanks, looking
[deleted] has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
dsk has quit [Ping timeout: 272 seconds]
<energizer> man these docs are amazing
<energizer> hmm i'm still missing something. I introduce a number type positive-number that implements (increment x) and another one even-number that also implements (increment x). then another type positive-even-number that's both positive-number and even-number. If I have a positive-even-number and call (increment x) on it, which implementation gets called -- positive-number's or even-number's?
<energizer> er s/type/class i guess
sm2n_ has joined #commonlisp
lisp123_ has joined #commonlisp
sm2n has quit [Ping timeout: 252 seconds]
<moon-child> energizer: languages with typeclasses are statically typed; x will have a particular type, and that type will determine the method which is chosen. This is completely unlike anything in cl
<moon-child> so for instance, say you have typeclass String with a method add and a typeclass Int with method add. Then you say something like: frob :: String a => a -> a -> a; frob x y = add x y
<moon-child> that will use the method from the String typeclass because x and y have type String
<moon-child> in a case when it's ambiguous, that's a compile error
lisp123_ has quit [Ping timeout: 268 seconds]
yitzi has quit [Quit: Leaving]
<energizer> so far so good
dsk has joined #commonlisp
<moon-child> typeclasses generally do not inherit. So your example with positive-even-number wouldn't be expressible
<energizer> is there a similar ambiguity that could happen to a single-parameter function in cl?
<energizer> for context, julia (dynamic, vaguely lispy) is trying to figure out a trait system but people are worried about how to handle the ambiguous cases for objects that have lots of traits
<Josh_2> You might be interested in The Art of the Metaobject Protocol
<energizer> * is the previous return value?
<Josh_2> yes
<energizer> ok so the answer here is that the order is determined lexically in the standard multiple-inheritance way
<Josh_2> This is just the default behaviour, there is an example in AMOP that demonstrates how to change the inheritance to suit your needs
<Josh_2> CLOS can be adjusted to suit the problem
<energizer> thanks, i'll check that out
<Josh_2> Julia should solve its problem by implementing a MOP :P
<Josh_2> Then the programmers can decide how they wish to handle this problem on a case by case basis with the Julia devs providing some default behaviour
<Josh_2> (or the julia programmers should just become CL devs ;) )
wheelsucker has joined #commonlisp
char has joined #commonlisp
elf_fortrez has joined #commonlisp
<Josh_2> huh for some reason my company mode has just stopped working in SLy
prxq_ has joined #commonlisp
<Josh_2> ah seems i have to hit tab now
akoana has quit [Quit: leaving]
prxq has quit [Ping timeout: 268 seconds]
killsushi has joined #commonlisp
killsushi has quit [Changing host]
killsushi has joined #commonlisp
elf_fortrez has quit [Ping timeout: 246 seconds]
karlosz has quit [Quit: karlosz]
karlosz has joined #commonlisp
<beach> Good morning everyone!
Lycurgus has quit [Quit: Exeunt]
Mrtn[m] has joined #commonlisp
Bike has quit [Quit: sleep]
CrashTestDummy2 has quit [Quit: Leaving]
CrashTestDummy has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 265 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<Josh_2> Good morning beach
[deleted] has joined #commonlisp
cjb has quit [Quit: brb]
livoreno has quit [Ping timeout: 252 seconds]
<Josh_2> my largest cl project is coming up on 11 thousand lines now :O
<White_Flame> nice, you can get a LOT of functionality in that scope
<Josh_2> I'd like to think I have used my lines wisely
cjb has joined #commonlisp
karlosz has quit [Quit: karlosz]
karlosz has joined #commonlisp
<contrapunctus> Josh_2: that's cool, what does it do?
<Josh_2> most of the code is a bot for the matrix protocol
<Josh_2> I reckon most of the code in the bot is in the modules, not sure though, never counted
hendursaga has quit [Remote host closed the connection]
hendursaga has joined #commonlisp
char has quit [Ping timeout: 268 seconds]
taiju has quit [Ping timeout: 268 seconds]
char has joined #commonlisp
taiju has joined #commonlisp
[deleted] has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
markasoftware_ is now known as markasoftware
derelict has quit [Quit: WeeChat 3.2]
<kakuhen> Is there a type associated to alists? I tried finding out by using type-of, and I am getting "CONS," which sounds a bit more general than alists to me.
<beach> There is no separate type for alists. You could create such a type, but it would have to involve SATISFIES.
<beach> Why do you want a type for it?
<kakuhen> because I have a class with a slot that I want exclusively for alists
<beach> So don't put anything else in that slot.
<mfiano> alexandria:alist
<beach> I don't quite understand why so many people are so focused on declaring explicit type for things.
<mfiano> Also note that TYPE-OF returns implementation-specific results.
<beach> I mean, in some languages, you have to, but that's not the case for Common Lisp.
Inline has quit [Quit: Leaving]
<beach> kakuhen: Also, forcing an alist seems like committing to implementation details too early? Are you sure you don't just want an instance of the dictionary abstract data type?
<kakuhen> im very sure i want an alist yeah
<kakuhen> regarding "declaring explicit type for things," I don't know why others want it, but I want it because I don't like silent failures when errorneous input is placed into a class' slot
<kakuhen> i want it to fail miserably, and loudly at it
<mfiano> beach: My guess would be either the anti-pattern that is optimizing everything, or the anti-pattern that is premature constraints
pve has joined #commonlisp
<beach> mfiano: Sounds plausible.
lisp123_ has joined #commonlisp
<mfiano> Type checks on class slots are not mandated by the standard, and implementations that do so may change their semantics in the future
<beach> kakuhen: OK, so what happens when someone accesses this slot, gets an alist, and then does (setf (cdr alist) 234)?
<mfiano> Instead you want to make use of check-type and assert
<beach> kakuhen: I mean, how are you planning to prevent that?
<mfiano> Type checks belong on accessors, not slots, in my honest opinion.
<kakuhen> well, with the implementations I've tried (sbcl, ccl, ecl), the type-checker is usually able to tell when you try setting a slot to something that violates the declared type of the slot
<beach> mfiano: Yes, slots are usually implementation details anyway.
<beach> kakuhen: But my example does not change the slot.
<kakuhen> yeah I know
<kakuhen> no idea what'd happen in the case of an alist, but ideally I'd want to be able to catch that
<mfiano> kakuhen: Why write code whose semantics are subject to change across implementations, or even locally on the same implementation in the future?
<beach> kakuhen: Then using types is not the right way.
<kakuhen> i guess im worrying too much about intentionally wrong usage of functions im making
<kakuhen> and classes
<beach> kakuhen: The reason I asked about the dictionary abstract data type, because for stuff like that, it is best to define an abstract data type with accessors, and then those accessors would verify preconditions and such.
<kakuhen> I see
<beach> Types just represent a tiny subset of the kind of preconditions you can imagine, and that is because that's the kind of subset they force to be decidable in statically typed languages.
derelict has joined #commonlisp
cjb has quit [Quit: end of day]
wilfred has joined #commonlisp
killsushi has quit [Read error: Connection reset by peer]
killsushi has joined #commonlisp
<flip214> pjb: ack, thanks for the confirmation!
char has quit [Ping timeout: 265 seconds]
shka has joined #commonlisp
lisp123_ has quit [Ping timeout: 252 seconds]
karlosz has quit [Quit: karlosz]
prxq_ is now known as prxq
CrashTestDummy2 has joined #commonlisp
char has joined #commonlisp
attila_lendvai has joined #commonlisp
CrashTestDummy has quit [Ping timeout: 252 seconds]
<kakuhen> is there a function like POSITION but for arrays?
<dsk> kakuhen: Yes. POSITION. :)
<kakuhen> confusing
<kakuhen> the hyperspec says the sequence must be "proper" i.e. vector or list only
<dsk> Unless you mean multidimensional arrays?
<kakuhen> Yeah. I am dealing with 2d array, not vector.
<kakuhen> I haven't been able to find a built-in function for this, but if there isn't any, then it's fine
<kakuhen> Just means I have a make a helper function
<dsk> Ah, I see. Well, you could create a vector displaced to the 2d array, then.
Cymew has joined #commonlisp
froggey has joined #commonlisp
terpri has quit [Remote host closed the connection]
terpri has joined #commonlisp
char has quit [Ping timeout: 252 seconds]
seok has joined #commonlisp
treflip has joined #commonlisp
derelict has quit [Ping timeout: 268 seconds]
<coat> reading uiop source code: https://github.com/fare/asdf/blob/master/uiop/stream.lisp cannot find a consistent convention for docstring. some docstrings are declartive ("Calls FUNCTION with") but some are imperative ("Transform a portable ENCODING keyword"). is there any popular or preferred convention?
<coat> any good CL project source code I can read to pick good style and convention?
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
taiju has quit [Ping timeout: 265 seconds]
Tomte has joined #commonlisp
karlosz has joined #commonlisp
CrashTestDummy3 has joined #commonlisp
karlosz has quit [Client Quit]
<beach> coat: A function that deserves a documentation string is often part of a "protocol" which is generalization of an "interface".
karlosz has joined #commonlisp
<beach> coat: Then, you need to document things like the preconditions, the postconditions, and the invariants that the function requires and provides.
<coat> beach: is there a preferred grammar convention for such documentation, "Validate such and such thing" vs. "Validates such and such thing"?
<beach> coat: And you need to document the return value(s) and how they are obtained based on the input values, and perhaps on some internal state of some object. Finally, you need to document the way the function changes any such state.
<beach> coat: I use (what used to be) the GNU convention which is to use the imperative form.
<beach> But I have not seen any such convention written down.
CrashTestDummy2 has quit [Ping timeout: 252 seconds]
<coat> beach: thanks
taiju has joined #commonlisp
<coat> beach: what is the GNU convention? where did GNU use Lisp?
<coat> Emacs? Emacs Lisp?
<beach> Not specifically for Lisp.
<beach> The GNU convention is, or used to be, to use the imperative form.
<coat> okay
<beach> "Givcen a 2-3-tree and an object, insert the object into the tree. Return the modified tree."
<beach> Stuff like that.
<splittist> coat: I think that during development, consistency is the key thing (rather than the particular convention), as it will help you spot patterns and exceptions. When it comes to 'final' documentation for third-party consumers (which might be you in 6 months, of course), you should think from the 'outside in' (as beach describes) - starting with the overall picture and describing how the element fits into that.
<coat> since COND can do everything IF can, do you use IF in practice? Or do you simply use COND, WHEN, UNLESS and never use IF?
<beach> coat: Did I not tell you the general rule in programming to use the most precise construct that will do the trick?
<beach> coat: If is used in a context where a value is needed, and it should have both a `then' branch and an `else' branch.
<beach> WHEN and UNLESS are used in a context where there is only one branch, and where the value of the form is not needed.
<coat> beach: Hard to decide which one is more precise between IF and COND since both can support then branch and an else branch.
<coat> I know when to use WHEN and UNLESS. no confusion there.
<coat> my confusion is with COND vs. IF. do not see why I should ever use IF if COND does it what it can.
<beach> COND is used when you have more than two possible cases, or some people may use it to avoid a PROGN with the IF.
<beach> Because CONS is more general, so by using IF when you can, you immediately tell the person reading your code that there are only two possible cases.
<beach> That's the general rule I am referring to.
<beach> er, COND, not CONS.
<kakuhen> yeah, and IF will complain when you do not provide any code for the second case
<kakuhen> because of what beach said
<beach> Really? It should not.
<beach> Because the standard allows for that.
<kakuhen> oh i guess my implementation does that then, but not all of them do
<kakuhen> if you use IF like WHEN then it will throw a warning iirc
<beach> And here is another general rule of programming: the set of idiomatic phrases of any programming language (or natural language for that matter) is a tiny subset of the set of grammatical phrases. And you should always use only idiomatic phrases.
<moon-child> it would be nice if it could do the opposite, too
<moon-child> (issue a warning when 'when' is used in the manner of 'if')
* splittist still thinks comprehensive COND-MY-IF, IF-MY-COND, WHEN-MY-IF etc functionality is desirable in an IDE
<beach> kakuhen: Warnings are "signaled" and not "thrown" in Common Lisp. The THROW function does something entirely different.
<coat> yes, idioms are what I am trying to learn when I ask these questions
<moon-child> beach: maybe not _always_, certainly most of the time
<beach> I usually allow myself to make "pedagogical simplifications" in order to keep my utterances reasonably short.
hendursa1 has joined #commonlisp
<coat> Is it just me or are the parentheses screwed up in this answer: https://stackoverflow.com/a/7867968 the answer writes: (cond ((x y) (t z))). should it not be (cond (x y) (t z))?
<kakuhen> the answer is written correctly
<kakuhen> cond takes in a list of lists
<moon-child> beach: 'And you should use idiomatic phrases' is terser yet! :)
<kakuhen> and each individual list contains a condition and then what to do when it holds
<beach> moon-child: Point taken.
<beach> coat: You are right.
<beach> The parentheses are screwed up.
<coat> kakuhen: if that answer is written correctly, why does this error out: (cond ((t "hello")))
<beach> (cond (x y) (t z)) is right.
loke[m] has quit [Quit: Bridge terminating on SIGTERM]
Gnuxie has quit [Quit: Bridge terminating on SIGTERM]
dieggsy has quit [Quit: Bridge terminating on SIGTERM]
etimmons has quit [Quit: Bridge terminating on SIGTERM]
akanouras has quit [Quit: Bridge terminating on SIGTERM]
katco has quit [Quit: Bridge terminating on SIGTERM]
<flip214> coat: is the condition X or (X Y), ie. a function call?
luis` has quit [Quit: Bridge terminating on SIGTERM]
Mrtn[m] has quit [Quit: Bridge terminating on SIGTERM]
<coat> kakuhen: should it not be: (cond (t "hello"))
<coat> beach: thanks
hendursaga has quit [Ping timeout: 244 seconds]
<beach> flip214: It is supposed to be the same as (if x y z).
<flip214> the first one is more likely, as T has no function value (typically)
<flip214> beach: ah, thanks.
<jmercouris> beach: good morning!
<kakuhen> coat: yeah I didn't see how x y z were being used
<beach> Hello jmercouris.
<kakuhen> most of the time I use COND in my code it ends up looking like the answer
<jmercouris> you can also use MATCH from optima or trivia
<kakuhen> coat: e.g. as follows: (cond ((= 4 5) (format t "crazy~%") ('t (format t "sane~%"))))
<beach> jmercouris: Sure, if you want to confuse newbies even more than they already are.
<kakuhen> just imagine the newline characters are there
<jmercouris> :-D
<beach> kakuhen: What is that code supposed to mean? It looks wrong in several ways.
<kakuhen> missing parentheses now that i see it a second time
<beach> kakuhen: Please make an attempt to get your code right, especially when you are answering requests for advice.
<beach> kakuhen: And what on earth is 't?
<kakuhen> true
wilfred has quit [Quit: Connection closed for inactivity]
<kakuhen> In some codebases I see it written that way
<jmercouris> Really?
<jmercouris> which codebase?
<moon-child> perhaps there should be a 'useless use of QUOTE' award, à la cat
<jmercouris> let me know so I can avoid said codebase
<moon-child> kakuhen: my, I have never seen that
<beach> kakuhen: That is definitely not idiomatic.
<beach> kakuhen: You should create an "issue" for that code.
<moon-child> I wonder if it dates to some historic lisp dialect where t and nil were not self-evaluating?
<beach> Possibly.
<kakuhen> agh, i was searching in the textbook i saw this and now i can't find the example
<kakuhen> beach: granted, the instances i saw this happen were in emacs lisp, not common lisp
<kakuhen> i have no idea how the conventions differ
<susam> coat: That answer indeed has an error. I have gone ahead and fixed it and also included kakuhen's example to that answer for further clarity: https://stackoverflow.com/a/7867968/303363 .
<kakuhen> the example i gave had unbalanced parens so i hope you fixed that
<pjb> Well originally, 1 was used in cond, but in the first lisps, there was no characters, so strings were expanded to lists of symbols, and the symbol T was not NIL (which was 0), so (COND (T …)) would have worked as well as (COND (1 …)).
<pjb> So I don't think T was ever not true.
<kakuhen> once you fix my "example," it should be: (cond ((= 4 5) (format t "crazy~%")) (t (format t "sane~%")))
<susam> kakuhen: Yes, fixed that. Tested it on REPL before adding it to the SO answer.
selwyn has joined #commonlisp
<kakuhen> beach: OK I have found an instance of 't being used
<kakuhen> believe it or not, this is not the first time I've seen this.
<jmercouris> who said Paul Grahm is a good programmer?
<pjb> kakuhen: but it's not useful.
<kakuhen> irrelevant question; I'm simply denoting where I've seen this happen
<jmercouris> the question is most relevant
<kakuhen> sure, perhaps a "good programmer" would know better to not use 't, but the original question was where could I have possibly seen this
<kakuhen> would know better and not use*
<beach> kakuhen: Paul Graham is not known for respecting conventions.
dsk has quit [Ping timeout: 272 seconds]
<kakuhen> "not known for respecting conventions" or "known for not respecting" conventions?
<beach> Sorry, the latter.
<kakuhen> ok that makes sense to me then
ec has quit [Ping timeout: 244 seconds]
ec has joined #commonlisp
scymtym has joined #commonlisp
heisig has joined #commonlisp
dsk has joined #commonlisp
karlosz has quit [Quit: karlosz]
<dsk> I think the "point" of quoted T in that specific PG code was not assuming the existence of T and NIL in a toy interpreter. He doesn't do that in any of his book code.
<beach> Makes sense.
<moon-child> well, you have to assume the existence of NIL to at least some degree. T less so. But that does make sense
kevingal has joined #commonlisp
kakuhen has quit [Quit: Leaving...]
<pjb> (defconstant else t) (cond (foo bar) (else quux)) ; scheme like.
<moon-child> pjb: afaik in scheme 'else' is special-cased by cond; you can't use it in any other context
<moon-child> can't use it that way in any other context, I should say
<beach> So like our OTHERWISE?
<pjb> Yes, but otherwise is for case, not cond.
<beach> Right.
lisp123 has joined #commonlisp
<splittist> That keeps tripping me up
lisp123 has quit [Remote host closed the connection]
<dsk> OTHERWISE is necessary in CASE because you might want to check if the value of the test key is T.
<dsk> Well, that's not exactly true, you can also use T, but that gets confusing.
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
<mfiano> dsk: One can use ((t ...) ..) for that.
<jackdaniel> moreover when you test for nil, you must ((nil) …)
<dsk> mfiano: Right, but (case test-key ((t) ...) (t ...)) is visually confusing, as is (case test-key ((otherwise) ...) (otherwise ...))
<jackdaniel> otherwise it will be treat as (() …) ,)
<mfiano> (case t (b "B") ((a t) "A or T")) ; => "A or T"
<mfiano> I don't see how it is confusing. It is very intuitive
<dsk> Fair enough, carry on then.
<mfiano> I could see how something like this might be confusing, which is probably why such a long word (that I never use) was chosen: (case 'otherwise ((otherwise) "otherwise") (otherwise "everything else"))
<dsk> I suppose I'm just guessing at why OTHERWISE exists in the first place.
selwyn has quit [Read error: Connection reset by peer]
xantoz has quit [Ping timeout: 272 seconds]
lisp123 has joined #commonlisp
lotuseater has joined #commonlisp
Nilby has joined #commonlisp
tyson2 has joined #commonlisp
<jackdaniel> jmercouris: while I can't tell whether he is a good programmer, he is (was) certainly a good teacher of common lisp; his books are excellent learning material (even if opinionated)
<mfiano> More opinionated than Hoyte? ;)
<jackdaniel> nah
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
<jackdaniel> and I think that pcl is also opinionated (but more aligned with the prevailing cl style)
lisp123 has quit [Ping timeout: 246 seconds]
<jackdaniel> (on the other hand, cl as a standard is fairly unopinionated)
<jackdaniel> now put your favourite meaning to a vaglue word "opinion" and cheerfully agree ,-)
<jackdaniel> vague*
<mfiano> I opine that most Lispers are very opinionated.
<jackdaniel> :)
<edgar-rft> who wants to read a book from an author who has no opinion? :-)
<jackdaniel> alright, I admit that this was not the best word to describe this particular quality of pg books ,) either way, my point is that I've found his CL books to be very good:)
<edgar-rft> In my experience a good way to learn something is to work with people who see things different than yourself. Who is right we'll see in the end.
<shka> hi all
<shka> how do i obtain exit code from the uiop proccess-info?
<shka> uh, sorry i am silly, there is wait-proccess
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
Tomte has quit [Quit: Leaving]
xantoz has joined #commonlisp
selwyn has joined #commonlisp
lisp123 has joined #commonlisp
<lisp123> if I have (let ((values (fn-that-returns-values ...)))) where fn-that-returns-values returns via (values ...), will I lose the other values if I don't put in a multiple value bind?
<lisp123> or can i keep returning (values ...) up a stack and only need multiple value bind to catch them when I need them?
<lisp123> I assume the former, but its a bit annoying..
<susam> lisp123: Definitely the former. The extra values would be lost without multiple-value-bind. It should be easy to test it out.
<lisp123> susam: I suspected as much
<lisp123> thanks
random-nick has joined #commonlisp
<lisp123> I think I will try and write a macro that combines let and m-v-b
<lisp123> e.g. (let* ((x 55)((y z) (values 32 49)))...) and it works
<splittist> Why not? Everyone else has (:
<lisp123> really? thats nice to hear
yitzi has joined #commonlisp
<lisp123> I guess I could just use a structure
<lisp123> maybe that's the canonical way and m-v-b should be relegated to only prototyping
<phadthai> or a list, or vector, or clos type
<lisp123> phadthai: I use list a lot but sometimes it has issues when you get to the last e-element and have nils
<phadthai> I fould returning values useful for C FFI layers where return value as well as errno were useful
<phadthai> a second value that is
<lisp123> that makes sense
<lisp123> so not a "main" value, but something that is useful from time to time
<phadthai> so in a way it's similar to optional arguments, but optional additional return information
<lisp123> makes sense
<lisp123> and perhaps within a function, i.e. the values are not meant to be passed outside the funciton but only between parts of a function
selwyn has quit [Remote host closed the connection]
<phadthai> in the case of FFI it was a low-level layer, with higher level conditions able to use and present the extra information in a more lispy way
selwyn has joined #commonlisp
<lisp123> good to know
<yitzi> drmeister Bike: I've hit a wall on both Arch and Ubuntu during build. I am getting this https://plaster.tymoon.eu/view/2526#2526
<yitzi> Sorry...wrong room
silasfox has joined #commonlisp
derelict has joined #commonlisp
silasfox has quit [Ping timeout: 246 seconds]
silasfox has joined #commonlisp
amk has quit [Remote host closed the connection]
amk has joined #commonlisp
<jmercouris> does anyone remember a "visual" scheme programming language?
<jmercouris> wait a second, we have a log!
<jmercouris> in case anyone is wondering: https://github.com/disconcision/fructure
<contrapunctus> jmercouris: wow. That's fancy, thanks for sharing.
makomo has joined #commonlisp
killsushi has quit [Quit: Leaving]
<jmercouris> it really makes you think how it could be
Bike has joined #commonlisp
silasfox has quit [Ping timeout: 240 seconds]
silasfox has joined #commonlisp
lisp123_ has joined #commonlisp
mmk2410 has joined #commonlisp
lisp123_ has quit [Ping timeout: 256 seconds]
Equill has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
silasfox has quit [Ping timeout: 256 seconds]
yitzi has quit [Quit: Leaving]
tyson2 has quit [Ping timeout: 256 seconds]
tyson2 has joined #commonlisp
silasfox has joined #commonlisp
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #commonlisp
silasfox has quit [Ping timeout: 256 seconds]
silasfox has joined #commonlisp
Cymew has quit [Ping timeout: 268 seconds]
char has joined #commonlisp
slant has joined #commonlisp
yitzi has joined #commonlisp
Inline has joined #commonlisp
char has quit [Ping timeout: 246 seconds]
silasfox has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Ping timeout: 252 seconds]
silasfox has joined #commonlisp
lisp123_ has joined #commonlisp
lisp123_ has quit [Ping timeout: 246 seconds]
amb007 has quit [Ping timeout: 268 seconds]
amb007 has joined #commonlisp
<Josh_2> Helloo
<beach> Hello Josh_2.
tyson2 has quit [Remote host closed the connection]
varjag has joined #commonlisp
<Josh_2> Hi beach how is your work coming along?
<beach> Slow but steady progress, thank you. Yours is going well apparently.
<Josh_2> Yes its going well, been working non stop on it, my life cycle is currently eat sleep code workout xD
<beach> Mine is close. I add "spend time with my (admittedly small) family", and "go buy food".
<coat> so do you both use CL for work too? what kind of job do I need to look for to be able to use CL for work?
AnimalClatter has quit [Quit: WeeChat 3.0.1]
<Josh_2> I am trying to make my own work, could go wrong, could go well
AnimalClatter has joined #commonlisp
<beach> coat: I am a researcher, and I use Common Lisp both as a tool in my work and as the subject of my research.
<beach> coat: My main project: https://github.com/robert-strandh/SICL
<coat> beach: that is nice! do you also see your peers using CL as tool and as subject of research?
<beach> A few.
<beach> coat: my favorite coauthor for instance: https://dept-info.labri.fr/~idurand/
waleee has joined #commonlisp
<susam> beach: I like your website a lot. Bookmarking it. Many nice articles to read there.
<beach> Thank you.
selwyn has quit [Read error: Connection reset by peer]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 246 seconds]
amb007 has joined #commonlisp
pve_ has joined #commonlisp
pve has quit [Ping timeout: 272 seconds]
<flip214> Is there a library that returns 4KB for an input of 4096, and 10.4MB for 10600000, etc.?
<shka> flip214: you wanna convert units?
<flip214> shka: well, only nicely format sizes given in bytes to KB, MB, etc.
<shka> i see
raeda has quit [Ping timeout: 252 seconds]
<shka> well, if that's all you need, you may just roll your own
<flip214> never mind, did a quick hack
<shka> ok, great!
<flip214> with <2000, I didn't want any decimal point (as there is none in integers!), but bigger things should have one, etc.
tfb has joined #commonlisp
raeda has joined #commonlisp
cage has joined #commonlisp
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
tfb has quit [Quit: died]
sm2n has joined #commonlisp
sm2n_ has quit [Ping timeout: 268 seconds]
varjag has quit [Remote host closed the connection]
varjag has joined #commonlisp
Equill has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
frgo has quit [Read error: Connection reset by peer]
frgo_ has joined #commonlisp
lad has joined #commonlisp
lisp123_ has joined #commonlisp
mojvei has joined #commonlisp
frgo has joined #commonlisp
karlosz has joined #commonlisp
mojvei has quit [Client Quit]
frgo has quit [Remote host closed the connection]
mojvei has joined #commonlisp
frgo_ has quit [Ping timeout: 250 seconds]
frgo has joined #commonlisp
mojvei has quit [Client Quit]
CrashTestDummy2 has joined #commonlisp
dlowe has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 272 seconds]
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
<lisp123_> I read somewhere that flycheck provides on-the-fly syntax checking
<lisp123_> something I should explore? TBH through formatting I don't really make much mistakes, the worse thing I do is accidentally having a function as a variable or vice versa (e.g. (+ 1 (+ 1 2)) vs (+ 1 + 1 2) (wrong
atgreen has quit [Quit: Leaving]
clos-encounters has joined #commonlisp
<clos-encounters> while writing macros that expand into defmethod forms, I read in the hyperspec that method qalifiers can be any object. I was surprised because I'd enver seen qualifers as anything but keyword objects. How common is it to see non-keyword qualifiers, and does anyone know of code out there for parsing the cdr of a defmethod form?
<Bike> using custom qualifiers at all is not common, but i've seen numbers once or twice, and i think there's an example with them in clhs or amop somewhere
<Bike> for parsing defmethod, any implementation has code for it; for example here's sbcl's https://github.com/sbcl/sbcl/blob/master/src/pcl/boot.lisp#L2869-L2880
<clos-encounters> super thanks
<Bike> it's not that complicated, just that the first list you hit is the lambda list, and everything before that is a qualifier
<clos-encounters> yeah makes sense. I see you've already been where my brain is now.
frgo_ has joined #commonlisp
frgo has quit [Ping timeout: 240 seconds]
selwyn has joined #commonlisp
frgo_ has quit [Remote host closed the connection]
frgo has joined #commonlisp
silasfox has quit [Ping timeout: 256 seconds]
CrashTestDummy3 has joined #commonlisp
silasfox has joined #commonlisp
CrashTestDummy2 has quit [Ping timeout: 240 seconds]
lisp123_ has quit [Remote host closed the connection]
selwyn has quit [Read error: Connection reset by peer]
tyson2 has joined #commonlisp
lisp123_ has joined #commonlisp
pve_ is now known as pve
slant has quit [Ping timeout: 256 seconds]
CrashTestDummy2 has joined #commonlisp
CrashTestDummy3 has quit [Ping timeout: 256 seconds]
frgo_ has joined #commonlisp
frgo has quit [Ping timeout: 240 seconds]
Colleen has quit [Quit: Colleen]
frgo_ has quit [Remote host closed the connection]
frgo has joined #commonlisp
Colleen has joined #commonlisp
silasfox has quit [Ping timeout: 246 seconds]
silasfox has joined #commonlisp
nij- has joined #commonlisp
lisp123_ has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
lisp123_ has quit [Remote host closed the connection]
lisp123_ has joined #commonlisp
<jcowan> I would probably write 't or 'nil to communicate the intention of using them as particular symbols.
<jcowan> By the way, does the term "exception" actually have a technical meanimng in CL talk?
<dlowe> It does not.
cage has quit [Quit: rcirc on GNU Emacs 27.1]
frgo_ has joined #commonlisp
<dlowe> You throw and catch tags in CL. You can signal conditions. If you say "throw exception" most people will know what you mean, but some will argue about it.
<dlowe> So avoid it unless you like arguments.
Nilby has quit [Ping timeout: 256 seconds]
frgo has quit [Ping timeout: 256 seconds]
nij- has quit [Quit: #commonlisp]
lisp123_ has quit [Remote host closed the connection]
<shka> i honestly never used throw in CL
<mfiano> catch and throw are very useful
<shka> mfiano: care to explain how would i use those?
<mfiano> Simple. They are dynamically-scoped and dynamically-valued equivalents of BLOCK and RETURN-FROM.
<shka> ooooooh, i get it
<shka> mfiano: thanks
<yitzi> I use them in common-lisp-jupyter in between two separate message loops in different threads to implement interrupts, etc.
cage has joined #commonlisp
cage has quit [Client Quit]
<jcowan> Presumably handler-case uses catch/throw under the covers somewhere
<jcowan> (or is it handler-bind? I get those confused)
<shka> no, handler-bind does not unwind the stack
<yitzi> handler-case does, although the clhs seems imply that a naive implementation uses tag-body.
kevingal has quit [Remote host closed the connection]
ec has quit [Remote host closed the connection]
ec has joined #commonlisp
treflip has quit [Remote host closed the connection]
slant has joined #commonlisp
frgo_ has quit [Remote host closed the connection]
frgo has joined #commonlisp
clos-encounters has quit [Ping timeout: 272 seconds]
<Bike> the handler-case example in the clhs is pretty much how it's usually implemented. the tagbody/go still does a nonlocal exit just like a block/return-from would
<pjb> yitzi: yes but tagbody go needs to perform non-local exits since you can put GO in closures.
<Bike> it's written that way because the unwinding takes place before the handler code is executed
amb007 has quit [Read error: Connection reset by peer]
<yitzi> roger
<pjb> As any other implementation the =bocl= implementation provides a
<pjb>
<pjb>
amb007 has joined #commonlisp
<pjb> s/As.*a//
makomo has quit [Quit: WeeChat 3.0.1]
lisp123_ has joined #commonlisp
slant has quit [Ping timeout: 240 seconds]
akoana has joined #commonlisp
shka has quit [Ping timeout: 265 seconds]
forloop has joined #commonlisp
<forloop> Hi
lisp123_ has quit [Ping timeout: 256 seconds]
<forloop> What time zone is this channel most active?
<akoana> I don't know, but maybe the logs of this channel can give you a clue: https://irclog.tymoon.eu/libera/%23commonlisp
<pjb> forloop: several.
<pjb> forloop: there are american lispers, european lispers, and even some japanese lispers.
clos-encounters has joined #commonlisp
<pjb> forloop: furthermore, hackers are often shifted.
waleee has quit [Ping timeout: 246 seconds]
<jcowan> and American lispers come in two flavors, East Coast (UTC-4) and West Coast (UTC-7)
<jcowan> Does anyone use a debian-alternatives group for CL implementations? I don't see why there shouldn't be one; is it a matter of "nobody cares"?
forloop has quit [Quit: Client closed]
ec has quit [Ping timeout: 244 seconds]
lisp123_ has joined #commonlisp
pieguy128 has quit [Quit: ZNC 1.8.2 - https://znc.in]
pieguy128 has joined #commonlisp
<pjb> jcowan: definitely.
* jcowan hates highly knowledgeable trolls
<pjb> (east/west)
<jcowan> oh, I thought that was an answer to my question! Sorry about that.
<Josh_2> how can I convert a list like '(lambda (var1 var2) (= var1 var2)) into a lambda?
<Josh_2> do I have to use eval?
ec has joined #commonlisp
kakuhen has joined #commonlisp
<Josh_2> maybe I'm just going about this the wrong way
<Bike> eval or coerce or compile
<Bike> you probably don't want to do this
<Josh_2> Yeh I dont think I'm doing this the most optimal way, however it is at the class definition level so its not like I'm letting random users execute arbitrary code
<Bike> what is the context?
<Josh_2> One sec I'll just show you the code
<edgar-rft> '(lambda (var1 var2) (= var1 var2)) == (quote (lambda (var1 var2) (= var1 var2))) so (cdr '(lambda (var1 var2) (= var1 var2))) should work, but is whacky code.
<Bike> i think josh would like a function as the result
<Josh_2> Yes something I can pass to apply
<Josh_2> I think this code demonstrates exactly what I'm trying to achieve
<Bike> hmm. i see.
<Josh_2> yeh
<Josh_2> tbf I could just have two lambdas and get rid of the expected args key
<Bike> i don't really see a way to construct the function ahead of time except by controlling the macroexpansion of defclass, but that's not really possible, unfortunately
<Bike> so yeah, eval or compile or something
<pl> jcowan: there's a lot of bad blood from good-faith-but-horrible-ends debian packaging issues
<Josh_2> Okay :)
<Josh_2> I dont think either compile or eval are actually a problem in this context
<Bike> it's not a security problem, it's more about confusion and timing
<jcowan> pl: Ah. Still, this isn't exactly packaging: it just lets you invoke Your Favorite Lisp with a single name like "cl"
<Bike> the function will be compiled/evaluated when the class is finalized
<Josh_2> yes thats okay
<Bike> which could be, for example, the first time an instance of it is made
<Bike> which might surprise people, performancewise
<Bike> it will still work
<pl> jcowan: it's heavily related to the mechanisms provided by debian packages though - and when people are soured on those...
bilegeek has joined #commonlisp
<pl> there was also not enough information of using alternatives outside of official packages
<Josh_2> I think in this case the class object itself is what is being used, not instances of the class
Krystof has quit [Ping timeout: 265 seconds]
<Bike> the standard lets classes be finalized only at the point they definitely have to be - when an instance is made
<Bike> meaning computing effective slots and stuff isn't done until then
<Bike> i think sbcl works this way but i'm not sure
<Bike> other implementations are more eager
<Josh_2> ah I see
<Josh_2> if I just used (make-instance 'direct-message) after my defclass that would do it?
<Bike> sure. you can also call mop:finalize-inheritance
tyson2 has quit [Ping timeout: 246 seconds]
<Bike> but it's not something that you have to do. just thought i should mention it.
<pjb> Josh_2: where do you use %build-function?
<jcowan> pl: Only in the sense that particular packages arrogate priorities to themselves. If you set up your own groups, it's just a mechanism for managing symlinks.
<Josh_2> pjb: I dont, I should have removed it
<pjb> Josh_2: as a macro, its macroexpansion would result in a function so you wouldn't need to consider eval compile or coerce.
dlowe has quit [Ping timeout: 240 seconds]
<Josh_2> oh
<pjb> Josh_2: a-priori, eval would produce an interpreted function, compile a compiled function, and coerce,whatever the implementation prefers. But it's entirely implementation dependent.
<pjb> Josh_2: in your case, I'd go with compile.
<pjb> Since you wouldn't define classes in an inner loop, to call it only once.
<pjb> Josh_2: when you want to call a lambda-expression as a one-shot, then eval is indicated.
<Josh_2> right
<Josh_2> fortunately in this case I dont, a compiled function is exactly what I want :D
yitzi has quit [Quit: Leaving]
<pjb> Josh_2: in your lambda, you could wrap the body in a block.
<Josh_2> I have done that now
<Josh_2> wrapped in (locally ...)
<pjb> `(lambda (…) (block fn #|or a better name|# …)) `(lambda (…) (block validator …))
<Josh_2> okay thats not what I thought you meant
<Josh_2> Why would I want to do that?
<pjb> So the expression can use (return-from validator …) or (return-from fn #|or a better name|# …)
<Josh_2> hmm
<Josh_2> that is something I dont think I have ever done
<Josh_2> blocks have a separate namespace right?
<pjb> Yes.
<Josh_2> well whats the harm then
<Bike> if you want to be really free with validators it might be easiest to write (send-otp ... :validator validate-send-otp), then (defun validate-send-otp (unique-id username otp) ...)
<Josh_2> yes I have considered that
<Josh_2> I think I will add the functionality for both
pve has quit [Quit: leaving]
clos-encounters has quit [Ping timeout: 268 seconds]
slant has joined #commonlisp
<Josh_2> How do I add a new keyword argument to my defclass form?
<Josh_2> I have private-key in my slot but I'd like it in my defclass and then to fill each slots private-key with the one found in the defclass form
<Josh_2> lul okay that was easy
tyson2 has joined #commonlisp
dsk has quit [Ping timeout: 256 seconds]
lisp123_ has quit [Remote host closed the connection]
varjag has quit [Quit: ERC (IRC client for Emacs 28.0.50)]
loke[m] has joined #commonlisp
katco has joined #commonlisp
Mrtn[m] has joined #commonlisp
dieggsy has joined #commonlisp
Gnuxie has joined #commonlisp
akanouras has joined #commonlisp
etimmons has joined #commonlisp
luis` has joined #commonlisp
Mrtn[m] has quit [Quit: node-irc says goodbye]
loke[m] has quit [Quit: node-irc says goodbye]
Gnuxie has quit [Quit: node-irc says goodbye]
katco has quit [Quit: node-irc says goodbye]
akanouras has quit [Quit: node-irc says goodbye]
etimmons has quit [Quit: node-irc says goodbye]
dieggsy has quit [Quit: node-irc says goodbye]
luis` has quit [Quit: node-irc says goodbye]
lotuseater has quit [Quit: ERC (IRC client for Emacs 27.2)]
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
loke[m] has joined #commonlisp
katco has joined #commonlisp
Gnuxie has joined #commonlisp
dieggsy has joined #commonlisp
Mrtn[m] has joined #commonlisp
akanouras has joined #commonlisp
etimmons has joined #commonlisp
luis` has joined #commonlisp
lisp123_ has joined #commonlisp
lisp123_ has quit [Ping timeout: 256 seconds]
slant has quit [Remote host closed the connection]
slant has joined #commonlisp
hendursaga has quit [Ping timeout: 244 seconds]
heisig has quit [Quit: Leaving]
akoana has quit [Quit: leaving]
bilegeek has quit [Quit: Leaving]
hendursaga has joined #commonlisp
yitzi has joined #commonlisp
slant has quit [Remote host closed the connection]
slant has joined #commonlisp
slant has quit [Remote host closed the connection]
slant has joined #commonlisp