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/>
jonatack has quit [Ping timeout: 265 seconds]
nij- has quit [Ping timeout: 246 seconds]
X-Scale has joined #commonlisp
nij- has joined #commonlisp
nij_ has joined #commonlisp
nij- has quit [Killed (NickServ (GHOST command used by nij_))]
<nij_> One thing I find weird about CL type system is the SATISFIES keyword. It doesn't seem to support sane interface. Can I safely assume that the "types" mentioned in CL is not as what other people mean usually?
nij_ is now known as nij-
nij_ has joined #commonlisp
nij- has quit [Killed (NickServ (GHOST command used by nij_!~jin@180-144-4-102f1.kyt1.eonet.ne.jp))]
nij- has joined #commonlisp
<nij-> Ooops my first message didn't send through: > I've always been confused with the difference between classes and types. Until today, I read [1] which seems to make it click. My summary is that classes are moer about implementation details, while types are more about their interfaces. That's maybe why types support polymorphisms with more sanity. [1]
<ixelp> Differences between subtypes and subclasses
<pjb> nij-: first thing to note, is that there's no first class types in Common Lisp (there's no type type). What we have are type DESIGNATORS, mere sexps denoting types.
<pjb> nij-: there's a little exception, for classes, since classes are type designators for the set of their instances, so in a way, class objects are first class types, but it's an exceptionnal situation, and #<class foo> is equivalent to foo as type designators.
<Bike> nij-: lisp types are different from types in most languages (and e.g. type theory) because they are quite explicitly sets, and moreover sets in naive set theory
<pjb> nij-: Well, types in CL forms a lattice. This is not always the case. They represent indeed sets of values, but all types should be sets of values.
<pjb> satisfies just takes a predicate. This (satisfies foop) = { x | foop(x) } which is perfectly defined set, therefore a perfectly defined type.
<pjb> well, it takes the name of a predicate.
<Alfr> self-not-included-p
<pjb> (defun self-not-included-p (x) (not (member x x))) (self-not-included-p '(a b c)) #| --> t |# (self-not-included-p '#1=(a b #1# d)) #| --> nil |#
<pjb> (deftype self-not-included () '(satisfies self-not-included-p)) (values (typep '(a b c) 'self-not-included) (typep '#1=(a b #1# d) 'self-not-included)) #| --> t ; nil |#
<nij_> I see. Thanks. I understand those as "CL types are more like sets, which differ from the types in most languages."
<Alfr> pjb, oh, no. I didn't mean that you can't define it, but that the result isn't a set.
<nij_> I wonder how types are implemented then.. can they be implemented by the users?
<pjb> nij_: the trick is that in lisp, it's values that have types, not variables. In languages like C, you declare the type of the variables, the type of boxes. But you can put any values in those variables (any bit pattern). In Lisp, all the boxes, all the variables can hold any value, each value having some types. (a whole lattice of types in general).
<pjb> nij_: of course, you can.
<pjb> Just like a compiler writter.
<pjb> For example, 42 is of type (integer 42 42), fixnum, (integer 0), (integer -1 333), of type (satisfies evenp), (member 21 33 42), (eql 42), etc…
<pjb> and also integer, ratio, real, number and t.
<pjb> So it would be difficult to restrict boxes to a single type…
<pjb> difficult and rather meaningless.
<nij_> Oh.. I should rephrase "I wonder how *usual* (i.e. non-CL) types are implemented then.. can they be implemented by the users?"
<pjb> Note also that in lattices, there are elements that are not comparables (sets that are not subset one of the other).
<Bike> nij-: that's classes, probably
<jcowan> More broadly considered, in statically typed languages, types are the types of expressions, not only variables.
<Bike> lisp types are attached to values rather than expressions or variables, which is part of why they're different
<nij-> Bike: what did you mean by "that" in "that's classes".
<Bike> "non-cl" types in lisp
<Bike> each value has exactly one direct class
rendar has quit [Ping timeout: 250 seconds]
<pjb> At least at one time.
<pjb> Because with change-class, a given object may have several different direct classes, at different times.
<aeth> But if you do things that are so dynamic that they might break things, that's on you... if someone CHECK-TYPEs and you get around that, well, you're probably now breaking the assumptions of the program.
random-nick has quit [Ping timeout: 255 seconds]
<aeth> CL is powerful enough to let you shoot yourself in the foot.
nij_ has left #commonlisp [Using Circe, the loveliest of all IRC clients]
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
nij- has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 255 seconds]
Lord_of_Life_ is now known as Lord_of_Life
mason is now known as ChibaPet
ChibaPet is now known as mason
occ has quit [Ping timeout: 276 seconds]
occ has joined #commonlisp
marsia has quit [Ping timeout: 252 seconds]
X-Scale has quit [Quit: Client closed]
Oladon has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
<beach> nij-: It is types in other languages that are strange and complicated, yet restricted. They must be so that types can be determined statically. And they don't even succeed very well. Determining the exact type of an expression is undecidable in general, so those languages do what they can to make it decidable.
nij- has quit [Ping timeout: 246 seconds]
nij- has joined #commonlisp
azimut_ has joined #commonlisp
elderK has quit [Quit: Connection closed for inactivity]
azimut has quit [Ping timeout: 255 seconds]
Oladon has quit [Quit: Leaving.]
_paul0 has joined #commonlisp
paul0 has quit [Ping timeout: 265 seconds]
Oladon has joined #commonlisp
Oladon has quit [Read error: Connection reset by peer]
pve has joined #commonlisp
rgherdt has joined #commonlisp
attila_lendvai has joined #commonlisp
shka has joined #commonlisp
attila_lendvai has quit [Ping timeout: 255 seconds]
Inline has quit [Quit: Leaving]
zxcvz has joined #commonlisp
_paul0 has quit [Remote host closed the connection]
_paul0 has joined #commonlisp
zxcvz has quit [Quit: zxcvz]
nij- has quit [Ping timeout: 246 seconds]
Lumine has joined #commonlisp
jmdaemon has quit [Ping timeout: 250 seconds]
Gleefre has joined #commonlisp
rendar has joined #commonlisp
rendar has quit [Changing host]
rendar has joined #commonlisp
aartaka has joined #commonlisp
LW has joined #commonlisp
genpaku has quit [Read error: Connection reset by peer]
genpaku has joined #commonlisp
aartaka has quit [Ping timeout: 265 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 255 seconds]
aartaka has joined #commonlisp
Bocaneri has joined #commonlisp
Bocaneri is now known as Guest8096
Sauvin has quit [Ping timeout: 246 seconds]
Gleefre has quit [Remote host closed the connection]
aartaka has quit [Ping timeout: 276 seconds]
aartaka has joined #commonlisp
Gleefre has joined #commonlisp
shka has quit [Quit: Konversation terminated!]
aartaka has quit [Ping timeout: 260 seconds]
random-nick has joined #commonlisp
cmack has joined #commonlisp
zxcvz has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
zxcvz has quit [Quit: zxcvz]
<pve> Hey! Does "hook" refer to the variable to which functions (or symbols) are added or does it refer to the *functions* that are added to the list variable? I think I've seen it used both ways.
<beach> I don't think Common Lisp has hooks.
<pve> hm it could be an emacs thing
<pjb> beach: (apropos-list "HOOK" "CL") #| --> (*debugger-hook* *macroexpand-hook*) |#
<beach> Oh, right you are. Sorry.
<pjb> pve: in general, to both. But I use meat for the functions, so I can hang meat on the hooks. ;-)
<pve> I have a list of symbols that name functions, and considered calling it a hook
<pve> haha
<pjb> pve: yes, the list is definitely a hook if the functions are called at specific point to allow for extensions.
<pjb> (the variable holding the list)
<pve> great, thanks
repeter`` has joined #commonlisp
repeter` has quit [Ping timeout: 276 seconds]
jonatack1 has joined #commonlisp
jon_atack has quit [Ping timeout: 248 seconds]
chrcav has quit [Ping timeout: 250 seconds]
chrcav has joined #commonlisp
_paul0 is now known as paul0
paul0 has joined #commonlisp
paul0 has quit [Changing host]
mathrick_ has quit [Ping timeout: 268 seconds]
Noisytoot is now known as [
mingus has quit [Ping timeout: 265 seconds]
aartaka has joined #commonlisp
marsia has joined #commonlisp
zxcvz has joined #commonlisp
mathrick has joined #commonlisp
jonatack1 has quit [Ping timeout: 246 seconds]
jonatack1 has joined #commonlisp
dcb has joined #commonlisp
nij- has joined #commonlisp
dipper has joined #commonlisp
dipper has quit [Remote host closed the connection]
nij- has quit [Ping timeout: 260 seconds]
[ has quit [Remote host closed the connection]
Noisytoot has joined #commonlisp
rgherdt has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
aartaka has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
aartaka has joined #commonlisp
infra_red[m] has quit [Quit: You have been kicked for being idle]
Equill has quit [Ping timeout: 255 seconds]
aartaka has quit [Ping timeout: 246 seconds]
aartaka has joined #commonlisp
Oladon has joined #commonlisp
cage has joined #commonlisp
jeffrey has joined #commonlisp
cage has quit [Remote host closed the connection]
cage has joined #commonlisp
kevingal has joined #commonlisp
kevingal has quit [Ping timeout: 256 seconds]
Oladon has quit [Quit: Leaving.]
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
jmdaemon has joined #commonlisp
euandreh has quit [Ping timeout: 276 seconds]
MajorBiscuit has joined #commonlisp
aartaka has quit [Ping timeout: 255 seconds]
aartaka has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
rgherdt_ has joined #commonlisp
Gleefre has quit [Remote host closed the connection]
rgherdt has quit [Ping timeout: 248 seconds]
attila_lendvai has joined #commonlisp
McParen has joined #commonlisp
infra_red[m] has joined #commonlisp
euandreh has joined #commonlisp
Lumine has quit [Quit: sleep]
masinter has quit [Remote host closed the connection]
Gleefre has joined #commonlisp
occ has quit [Ping timeout: 276 seconds]
occ has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
McParen has left #commonlisp [#commonlisp]
Gleefre has quit [Remote host closed the connection]
kagev has quit [Ping timeout: 255 seconds]
kagev has joined #commonlisp
<prxq> any mito users here?
<prxq> I'm wondering how to deal with the connection. ORMs in other languages have "sessions", which reconnect when the server times out. Mito does not seem to have something like it.
aartaka has quit [Ping timeout: 255 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 246 seconds]
cage has quit [Quit: rcirc on GNU Emacs 28.2]
pve has quit [Quit: leaving]
<pjb> Then you'd need to implement such session layer. That said, with modern network hardware, TCP is usually stable, it's rare that you get disconnected.
Gleefre has joined #commonlisp
<prxq> pjb: mysql actually times out.
<prxq> pjb: ok
azimut_ has quit [Ping timeout: 255 seconds]
n1to has joined #commonlisp
n1to has quit [Remote host closed the connection]
zxcvz has quit [Quit: zxcvz]
<prxq> i'm having trouble searching in tables for items having NULL values. Basically, SELECT column_names FROM table_name WHERE column_name IS NULL; Anyone knows how to specify this?
<prxq> It sucks also that I can't see the sql :-) somehow it's not printing it.
attila_lendvai has quit [Ping timeout: 246 seconds]
semz has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in]
semz has joined #commonlisp
<prxq> so no, you can't search for elements having a null field. That sucks. Very disappointing.
samedi has joined #commonlisp
<bitspook[m]> prxq: Is it not possible to use sxql to create mito objects?
<prxq> bitspook[m]: yeah but even there I'm not so sure. How'd you write a sxql search for a row with a null value?
<bitspook[m]> I suppose so. I haven't had a problem with building an SQL query with sxql so far; if worse comes to worse, you can write raw SQL.
<ixelp> SXQL> (select (:id :name :sex) (from (:as :person :p)) (where (:or (:>= :a - Pastebin.com
paul0 has quit [Remote host closed the connection]
paul0 has joined #commonlisp
<prxq> bitspook[m]: should produce 'where ... age is NULL'
<prxq> or in some incantation.
jeffrey has quit [Ping timeout: 264 seconds]
<ixelp> with-raw.lisp - Pastebin.com
<pjb> prxq: my advice would be to drop mysql and to use a real RDBMS. Try Postgres.
<prxq> pjb: this has nothing to do with that.
<prxq> would be the exact same problem on postgres or sqlite.
<bitspook[m]> prxq: Above is one way to do it without fighting sxql/mito too much. I am not sure what you're trying to do, but maybetry `(:raw "PART OF QUERY IN RAW SQL")`
<pjb> selecting null columns should work.
<prxq> bitspook[m]: thanks, that looks good!
<prxq> pjb: the problem is getting the right sql query out of the orm, Once the sql is correct, it finds them just fine
scymtym has quit [Remote host closed the connection]
scymtym has joined #commonlisp
cdegroot has quit [Read error: Connection reset by peer]
cdegroot_ has joined #commonlisp
Noisytoot has quit [Excess Flood]
Noisytoot has joined #commonlisp
MajorBiscuit has quit [Quit: WeeChat 3.6]
_paul0 has joined #commonlisp
paul0 has quit [Remote host closed the connection]
rgherdt_ has quit [Ping timeout: 246 seconds]
Gleefre has quit [Remote host closed the connection]
corinroyal has quit [Remote host closed the connection]