jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | offtopic --> #lispcafe
luckless has quit [Remote host closed the connection]
luckless has joined #lisp
VincentVega has quit [Remote host closed the connection]
wsinatra has joined #lisp
lowryder has quit [Ping timeout: 260 seconds]
Average-user has joined #lisp
<Average-user> join #lispcafe
* phoe hands Average-user a solidus
<Average-user> Yup, thanks. My keyboard sometimes trolls me
knowayback has joined #lisp
Krystof has quit [Ping timeout: 264 seconds]
Average-user has quit [Quit: WeeChat 2.8]
gaqwas has quit [Remote host closed the connection]
junkicide has quit [Ping timeout: 260 seconds]
lowryder has joined #lisp
<charles`> I emailed the author of cl-base64 to remove his nickname
kam1 has joined #lisp
flazh has quit [Ping timeout: 264 seconds]
flazh has joined #lisp
flazh has quit [Ping timeout: 240 seconds]
leo_song_ has joined #lisp
leo_song has quit [Read error: Connection reset by peer]
leo_song_ has quit [Remote host closed the connection]
leo_song has joined #lisp
mankaev has quit [Read error: Connection reset by peer]
mankaev_ has joined #lisp
<frodef> The package system (and missing module system) really needs revamping.
mindCrime has quit [Ping timeout: 260 seconds]
flazh has joined #lisp
wsinatra has quit [Quit: WeeChat 3.0]
wsinatra_ has quit [Ping timeout: 272 seconds]
flazh has quit [Ping timeout: 272 seconds]
X-Scale` has joined #lisp
random-nick has quit [Ping timeout: 256 seconds]
<moon-child> is there a version of mapcar which errors if the lists it applies to aren't the same length?
X-Scale has quit [Ping timeout: 246 seconds]
X-Scale` is now known as X-Scale
makomo has quit [Ping timeout: 240 seconds]
kam1 has quit [*.net *.split]
Jesin has quit [*.net *.split]
vhost- has quit [*.net *.split]
aeth has quit [*.net *.split]
bilal__ has quit [*.net *.split]
elflng has quit [*.net *.split]
grobe0ba has quit [*.net *.split]
sxmx has quit [*.net *.split]
xsperry has quit [*.net *.split]
Mandus has quit [*.net *.split]
phoe624 has quit [*.net *.split]
cg505 has quit [*.net *.split]
phantomics has quit [*.net *.split]
cross has quit [*.net *.split]
catern has quit [*.net *.split]
Cthulhux has quit [*.net *.split]
grumble has quit [*.net *.split]
justinmcp has quit [*.net *.split]
cpape has quit [*.net *.split]
dwts has quit [*.net *.split]
docl has quit [*.net *.split]
rgherdt has quit [Ping timeout: 268 seconds]
Jesin has joined #lisp
sxmx has joined #lisp
kam1 has joined #lisp
vhost- has joined #lisp
grobe0ba has joined #lisp
bilal__ has joined #lisp
Cthulhux has joined #lisp
cross has joined #lisp
phantomics has joined #lisp
elflng has joined #lisp
aeth has joined #lisp
cg505 has joined #lisp
xsperry has joined #lisp
Mandus has joined #lisp
phoe624 has joined #lisp
cpape has joined #lisp
justinmcp has joined #lisp
docl has joined #lisp
grumble has joined #lisp
dwts has joined #lisp
dwts has quit [Max SendQ exceeded]
kam1 has quit [Max SendQ exceeded]
sxmx has quit [Ping timeout: 249 seconds]
sxmx has joined #lisp
dwts has joined #lisp
andreyorst has quit [Remote host closed the connection]
andreyorst has joined #lisp
flazh has joined #lisp
<mfiano> I would think that would be too slow to be useful
<mfiano> So I would say no, unless some obscure library has something
Lycurgus has joined #lisp
<no-defun-allowed> I don't think so.
<no-defun-allowed> You iterate over all the lists, then instead of terminating when one is '(), you check if all are '(), and if not, then you signal an error.
<aeth> ah, netsplit
Lycurgus has quit [Client Quit]
<aeth> Fortunately, at least one log bot was on the "correct" side of the netsplit for anyone else who was confused
<aeth> The rest of us were wondering what these answers had to do with the package system. :-)
<aeth> frodef: There are some low-hanging fruits in package features, including hierarchical and versioned, although you can sort of fake the former with reexporting symbols and you can definitely do the latter manually (although only Alexandria does this afaik).
<aeth> frodef: But the solutions would be controversial so it would take a lot to get anything.
catern has joined #lisp
<frodef> aeth: The problem with CL is, it was so good back in 1990 that it's still "good enough" :-)
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
<aeth> frodef: No, it's more like... how many > 100 kloc projects are there written in CL that aren't CL compilers?
<aeth> Edge cases only really show up in really, really large projects.
<aeth> And compilers can just add whatever internals they want, so they're not really having to deal with mostly-portable CL.
kam1 has joined #lisp
<frodef> aeth: I tend to disagree, I suspect the lack of a global "module" system/architecture is holding CL back.
<no-defun-allowed> How do you handle having version X for one package, and version Y for another?
<no-defun-allowed> You might put versions in the package "names" or something, so they don't collide. But then would FIND-SYMBOL take a versioned name? These things seem hard with packages as bundles of sybmols.
<no-defun-allowed> *symbols
<frodef> no-defun-allowed: not easily with today's package system, I believe.
<aeth> no-defun-allowed: well, versioned can follow from... some kinds of hierarchical
<aeth> The new version just inherits from the old one for the most part. Sometimes removing, but mostly adding.
<no-defun-allowed> I think first class global environments, specifically sticking each module in a FCGE with its dependencies, is a good idea, but then you have edge cases like one module returning a FOO:B that's different to another module removing FOO:B, cause they came from different package objects.
<frodef> no-defun-allowed: FCGE?
<no-defun-allowed> So you might want to have package objects collude to not create duplicate symbol objects somehow, I dunno.
<no-defun-allowed> frodef: "First class global environment"
<aeth> no-defun-allowed: Versioned packages are way simpler than FCGE, though. Essentially you want to inherit symbols in a new package from an old one (several libraries do this, including UIOP and defpackage-plus afaik)
<White_Flame> PLN would allow you to have package foo-3.5: and package foo-3.6: simultaneously, but I think those canonical package versions are better handled in the .asd file than scattered around the source's defpackages & imports
<no-defun-allowed> Gnuxie tells me that in Self and Newspeak, module imports are just assignments to slots, so you can provide whatever objects you want. But packages, querying the environment for packages, and all that introspective stuff makes it harder.
<aeth> no-defun-allowed: Except, sometimes, you want to do one of three things: (1) remove a symbol (something deprecated got removed from the API), (2) add a symbol (by far the most common and totally safe), (3) replace a symbol (because foo.1:barfoo and foo.2:barfoo have two different implementations so they refer to two different functions)
<no-defun-allowed> Yeah, that much could be done with diffs. That'd handle deduping symbol objects across package versions.
akoana has joined #lisp
<aeth> You'd basically just semvar it, with the no-version version being the latest.
<aeth> *semver
<aeth> To complicate things a bit, you'd want one of the symbol conflict resolution options to be "don't use the latest, use this specific version instead"
<aeth> So if you USE my-package and it stops working because of a symbol conflict (and, yeah, USE is bad in general), then you can just use my-package.2 or whatever.
<aeth> Someone can probably do 95% of this as a library.
<fiddlerwoaroof> For most cases, loading the library then renaming the package Just Works
<fiddlerwoaroof> As long as you don't have any code that relies on a package name.
<fiddlerwoaroof> Anyways, I think using PLNs in code that ends up in Quicklisp is a Bad Idea
<fiddlerwoaroof> Personally, I tend to distinguish "code that I might eventually put into quicklisp" from "application code"
<fiddlerwoaroof> And only use implementation-specific features in the latter sorts of projects
hiroaki has quit [Ping timeout: 272 seconds]
hiroaki has joined #lisp
kam1 has quit [Read error: Connection reset by peer]
kam1 has joined #lisp
kam1 has quit [Client Quit]
plisp has joined #lisp
aorst has joined #lisp
plisp has quit [Client Quit]
mindCrime has joined #lisp
plisp has joined #lisp
andreyorst has quit [Ping timeout: 260 seconds]
aorst has quit [Client Quit]
andreyorst has joined #lisp
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #lisp
flazh has quit [Ping timeout: 256 seconds]
matryoshka has quit [Quit: ZNC 1.8.2 - https://znc.in]
matryoshka has joined #lisp
flazh has joined #lisp
galex-713 has joined #lisp
semz has quit [Ping timeout: 260 seconds]
oni_on_ion is now known as oni-on-ion
matryoshka has quit [Quit: ZNC 1.8.2 - https://znc.in]
bilal_ has joined #lisp
stzsch has joined #lisp
matryoshka has joined #lisp
cpape` has joined #lisp
sm2n_ has joined #lisp
pfdietz has quit [Ping timeout: 245 seconds]
DGASAU`` has joined #lisp
jonatack has quit [Ping timeout: 265 seconds]
grobe0ba_ has joined #lisp
docl_ has joined #lisp
Cthulhux` has joined #lisp
Lord_of_Life_ has joined #lisp
cg505- has joined #lisp
jonatack has joined #lisp
phoe6245 has joined #lisp
justinmcp_ has joined #lisp
cgay_ has joined #lisp
SumoSud0- has joined #lisp
aeth_ has joined #lisp
flazh1 has joined #lisp
cross_ has joined #lisp
elflng_ has joined #lisp
nicktick has quit [Ping timeout: 256 seconds]
froggey_ has joined #lisp
Mandus_ has joined #lisp
akoana_ has joined #lisp
matijja``` has joined #lisp
me_at_drewc_ca has joined #lisp
rumbler31 has quit [Remote host closed the connection]
akoana_ has quit [Client Quit]
ggoes_ has joined #lisp
leo_song_ has joined #lisp
rumbler31 has joined #lisp
akoana_ has joined #lisp
emacsoma1 has joined #lisp
zmagii_ has joined #lisp
lonjil2 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
leo_song has quit [*.net *.split]
Lord_of_Life has quit [*.net *.split]
aartaka has quit [*.net *.split]
emacsomancer has quit [*.net *.split]
jibanes has quit [*.net *.split]
sm2n has quit [*.net *.split]
stzsch|2 has quit [*.net *.split]
froggey has quit [*.net *.split]
DGASAU` has quit [*.net *.split]
MichaelRaskin has quit [*.net *.split]
ggoes has quit [*.net *.split]
fiddlerwoaroof has quit [*.net *.split]
drewc has quit [*.net *.split]
Iolo has quit [*.net *.split]
cgay has quit [*.net *.split]
mathrick has quit [*.net *.split]
zmagii has quit [*.net *.split]
matijja has quit [*.net *.split]
Posterdati has quit [*.net *.split]
lonjil has quit [*.net *.split]
SumoSud0 has quit [*.net *.split]
madnificent has quit [*.net *.split]
vert2 has quit [*.net *.split]
flazh has quit [*.net *.split]
Jesin has quit [*.net *.split]
akoana has quit [*.net *.split]
vhost- has quit [*.net *.split]
aeth has quit [*.net *.split]
bilal__ has quit [*.net *.split]
elflng has quit [*.net *.split]
Mandus has quit [*.net *.split]
grobe0ba has quit [*.net *.split]
xsperry has quit [*.net *.split]
phoe624 has quit [*.net *.split]
phantomics has quit [*.net *.split]
cg505 has quit [*.net *.split]
cross has quit [*.net *.split]
Cthulhux has quit [*.net *.split]
grumble has quit [*.net *.split]
justinmcp has quit [*.net *.split]
cpape has quit [*.net *.split]
docl has quit [*.net *.split]
grobe0ba_ is now known as grobe0ba
Lord_of_Life_ is now known as Lord_of_Life
Iolo has joined #lisp
fiddlerwoaroof has joined #lisp
grumble has joined #lisp
shifty has joined #lisp
akoana_ has quit [Client Quit]
wxie has joined #lisp
semz has joined #lisp
Nilby has joined #lisp
madnificent has joined #lisp
akoana has joined #lisp
jjong has joined #lisp
vhost- has joined #lisp
vert2 has joined #lisp
mathrick has joined #lisp
phantomics has joined #lisp
jibanes has joined #lisp
rumbler31 has quit [Remote host closed the connection]
flazh1 has quit [Ping timeout: 256 seconds]
flazh1 has joined #lisp
Aurora_v_kosmose has quit [Ping timeout: 240 seconds]
xsperry has joined #lisp
Jeanne-Kamikaze has quit [Quit: Leaving]
Aurora_v_kosmose has joined #lisp
andreyorst has quit [Remote host closed the connection]
rumbler31 has joined #lisp
rumbler31 has quit [Ping timeout: 258 seconds]
charlie770 has joined #lisp
charlie770 has quit [Client Quit]
<troydm> what does PACKAGE-INFERRED-SYSTEM means in QuickLisp?
<troydm> mfiano: thx
_whitelogger has joined #lisp
Aurora_v_kosmose has quit [Remote host closed the connection]
Aurora_v_kosmose has joined #lisp
Alfr_ has joined #lisp
<beach> Good morning everyone!
Alfr has quit [Ping timeout: 268 seconds]
<slyrus> morning beach!
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Read error: Connection reset by peer]
scymtym has quit [Ping timeout: 256 seconds]
charles` has quit [Ping timeout: 256 seconds]
Jesin has joined #lisp
Bike has quit [Quit: Lost terminal]
cantstanya has quit [Ping timeout: 240 seconds]
cantstanya has joined #lisp
charles` has joined #lisp
asarch has joined #lisp
wxie has quit [Quit: wxie]
wxie has joined #lisp
refpga has joined #lisp
KREYREN has quit [Remote host closed the connection]
KREYREN has joined #lisp
karlosz has quit [Quit: karlosz]
wxie has quit [Ping timeout: 264 seconds]
knowayback has quit [Ping timeout: 265 seconds]
asarch has quit [Quit: Leaving]
aeth_ is now known as aeth
refpga has quit [Ping timeout: 268 seconds]
xsperry has quit [Ping timeout: 264 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
refpga has joined #lisp
Misha_B has left #lisp ["ERC (IRC client for Emacs 26.3)"]
gko_ has joined #lisp
<beach> frodef: See http://metamodular.com/SICL/environments.pdf for a description of first-class global environments.
<troydm> okey this might sound like a dumb question but it seems that there are two local-projects directories when using roswell
<troydm> am I missing something?
<troydm> like how do I get a list of local-project directories?
<troydm> it seems like top level local-projects directory is not part of ql:*local-project-directories*
gioyik_ has quit [Quit: WeeChat 3.0]
<troydm> or rather roswell adds ~/.roswell/local-projects to ASDF registry but not ql:*local-project-directories*
refpga has quit [Ping timeout: 265 seconds]
elflng_ is now known as elflng
refpga has joined #lisp
<troydm> also one the side note which is the best readline repl for sbcl?
zacts has joined #lisp
zacts has quit [Client Quit]
<troydm> I've installed linedit but not sure maybe there are better alternatives
birdwing has joined #lisp
<moon-child> slime
<moon-child> failing that, I usually use rlwrap, but linedit is probably at parity with it
<troydm> moon-child: it has tab completion
<troydm> moon-child: I do use slime, but sometimes I start repl just to quickly check something
<troydm> old habit
<beach> troydm: Why would you do that if you already have SLIME running?
<troydm> beach: ohh, well I'm still learning to use SLIME
thmprover has quit [Quit: Up, up, and away]
_whitelogger has joined #lisp
saganman has joined #lisp
<fiddlerwoaroof> troydm: I use linedit all the time
<fiddlerwoaroof> Better integrated with lisp, although it has a couple bugs
<fiddlerwoaroof> Tab complete for symbols and M-i for documenting the current symbol is pretty handy
<troydm> yeah, I like it too
<fiddlerwoaroof> As for "why": I occasionally use lisp on servers where I don't have emacs installed
<fiddlerwoaroof> And, if I'm already doing stuff at the shell, sometimes it's easier just to use the REPL in the context of my current session rather than context-switching into emacs
Nikotiini has quit [Ping timeout: 260 seconds]
<no-defun-allowed> Although a touch convoluted, you could start SWANK on the server, then use SSH to port forward and M-x slime-connect to that.
<fiddlerwoaroof> Linedit is pretty good
<fiddlerwoaroof> As is the sb-aclrepl contrib
* Nilby fails
Nilby has left #lisp ["[deleted]"]
v0|d has quit [Remote host closed the connection]
Lycurgus has joined #lisp
bitmapper has quit [Quit: Connection closed for inactivity]
Nikotiini has joined #lisp
rumbler31 has joined #lisp
gutter has quit [Remote host closed the connection]
rumbler31 has quit [Ping timeout: 272 seconds]
chrisb has joined #lisp
gutter has joined #lisp
_whitelogger has joined #lisp
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
orivej has joined #lisp
narimiran has joined #lisp
flazh1 has quit [Ping timeout: 264 seconds]
refpga has quit [Ping timeout: 264 seconds]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
refpga has joined #lisp
flazh1 has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
flazh1 has quit [Ping timeout: 256 seconds]
charles` has quit [Ping timeout: 265 seconds]
nullman has quit [Ping timeout: 260 seconds]
nullman has joined #lisp
contrapunctus has joined #lisp
andreyorst has joined #lisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life has joined #lisp
equwal has joined #lisp
v_m_v has joined #lisp
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
andreyorst has quit [Quit: WeeChat 3.0]
andreyorst has joined #lisp
pve has joined #lisp
jjong has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hendursaga has quit [Ping timeout: 240 seconds]
hendursaga has joined #lisp
Ekho has quit [Ping timeout: 268 seconds]
akoana has left #lisp ["Leaving"]
flazh1 has joined #lisp
Posterdati has joined #lisp
hendursaga has quit [Ping timeout: 240 seconds]
refpga has quit [Ping timeout: 246 seconds]
equwal has quit [Quit: Lost terminal]
Ekho has joined #lisp
refpga has joined #lisp
nostoi has joined #lisp
mindCrime has quit [Ping timeout: 260 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
birdwing has quit [Remote host closed the connection]
birdwing has joined #lisp
mindCrime has joined #lisp
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
rgherdt has joined #lisp
mindCrime has quit [Ping timeout: 260 seconds]
shka_ has joined #lisp
<sauvin> in sbcl, I'm suddenly getting hit with an "undefined variable" error or warning when I try (setq a '(1 2 3 4 5)). What could be wrong?
<phoe> sauvin: SETQ
<phoe> toplevel SETQ in Common Lisp is undefined behavior
<phoe> and the examples in CLHS are, sadly, making heavy use of it
<sauvin> Yeah. Doesn't happen in gcl, just sbcl.
<phoe> define your variables before setting them - globals via DEFVAR or DEFPARAMETER, locals via LET or LET* or the other utilities for binding
<phoe> I can't recommeng GCL since it's been pretty much dead and non-conforming
<phoe> s/toplevel SETQ/toplevel SETQ on undefined variables/
<sauvin> Yeah, well, folks in this channel about 24 hours ago told me about that, which is why I'm asking. Worked in gcl, ain't working in sbcl, wtf!?
<phoe> mostly because SBCL is becoming more and more strict as of late
shifty has quit [Ping timeout: 260 seconds]
<phoe> as in, it sets off fireworks for more and more non-conforming code
amb007 has quit [Read error: Connection reset by peer]
<phoe> it's a good thing on one hand, and on the other, it has caused a fair share of breakages in libraries that were working before but then SBCL found ANSI CL conformance bugs in them
<sauvin> Oh, wonderful.
amb007 has joined #lisp
<phoe> and then the breakages get fixed after the initial anguish
<phoe> and we end up with better code overall.
<sauvin> Well, see, this was one of the reasons the folks here gave yesterday for me to move to sbcl: more conformant to the standard.
<phoe> and much more eager to warn the programmer
<sauvin> Anyway, yeah, using let solved my problem.
<phoe> the question with SETQ on symbols always is: where is this particular symbol defined to be a variable?
<phoe> if it's defined nowhere, SBCL will point that out
froggey_ is now known as froggey
<beach> sauvin: It's kind of the other way around. It "works" in SBCL, since it signals a warning, and it does not "work" in GCL because it lets a detectable undefined situation pass silently.
<phoe> beach: actually, it's undefined behavior, so an implementation is free *not* to warn
<beach> Hence "works".
<beach> ... and "kind of".
<phoe> so both SBCL and GCL/ECL/CCL/ABCL behavior groups are acceptable
<phoe> ;; which doesn't mean they are desirable
<beach> For some value of "acceptable", sure.
<sauvin> Any way to turn that particular warning off?
<phoe> the easiest: don't use toplevel SETQ
<beach> You absolutely don't want to do that.
<moon-child> why not define the variable properly? (defparameter a '(1 2 3 4 5))
<beach> sauvin: You should not rely on undefined behavior.
<sauvin> Because I don't understand it. I'm just now learning how to assign variables in lisp, and it's a lot more complex than in perl, and it's more complex than in the AutoLISP that I used to use heavily but haven't seen in twenty years.
<no-defun-allowed> You are going to understand it even less, if you attempt to intentionally break it.
<sauvin> So, anyway, let works at the top level. I'm a big fan of lexical variables anyway. I avoid globals wherever I can.
<beach> sauvin: How is (setq <variable> <value-form>) more complex than <variable> = <value-form>?
<sauvin> How am I intentionally breaking anything using let?
<phoe> using let, you aren't
<phoe> using toplevel setq, you might be
<sauvin> beach: in perl, "my $thing = 'stuff'" works regardless of where it appears.
<no-defun-allowed> You are not breaking anything with LET. You're also not really breaking things with SETQ on undefined variables on its own, but attempting to dispose of the warnings your implementation makes for using SETQ in that way is breaking it.
<moon-child> sauvin: setq is analogous to assignment, not declaration
<beach> sauvin: I am sorry to hear that.
<phoe> yep, not in Lisp
<sauvin> Hey: sbcl doesn't like top-level setq, I don't use it. Easy peasy.
<no-defun-allowed> my $thing = ... would be like wrapping the rest of the body in (let ((thing ...)) ...)
<moon-child> $thing = 'stuff' ←→ setq. my $thing = 'stuff' ←→ defparameter/let
<phoe> declaring local variables in Lisp is done via LET and LET* and some other similar operators
<beach> moon-child: Oh, good point.
<sauvin> moon-child, a hint from an old perl guy: ALWAYS use strict.
<no-defun-allowed> However, note that DEFVAR and DEFPARAMETER are always used to declare special variables, which are dynamically scoped. I think Perl is another one of the few languages with dynamically scoped variables.
<sauvin> defparameter can be used anywhere?
<phoe> sauvin: yes, but shouldn't
<phoe> it would define global variables from inside a local context
<no-defun-allowed> So they aren't exactly globals per se.
<no-defun-allowed> Yes, DEFUN, DEFPARAMETER and DEFVAR usually don't do what you want them to do, if you put them inside a function body.
<sauvin> perl DOES have dynamically scoped variables, but there are very few circumstances under which their use encouraged.
<phoe> see, it's similar in Lisp
<phoe> you usually don't want dynamic variables, unless you *do* want them
<no-defun-allowed> That is not so far off in Lisp; you use lexically scoped variables by default, but dynamic scoping is useful for cross-cutting "customization" of things.
<phoe> for true non-dynamic globals, there's https://github.com/lmj/global-vars
<sauvin> Yes, and i perl, I'd have to have some pretty convincing reason to use 'local', which means 'dynamic'.
<sauvin> I'll look at that later. For now, many years spent swearing at the machine (and destroying more than one keyboard in the process), I tend to disfavour global variables. I just wind up tripping over them.
<no-defun-allowed> For example, you can re-bind *standard-output* to send printed text somewhere else (provided it is printed to *standard-output*).
<sauvin> Had to do that already. *default-external-format* defaults to utf-8, but trying to read a couple of files I have caused sbcl to puke, so I had to change that variable to ISO-mumble.
<phoe> sauvin: sure, then use LET and friends as much as possible
<no-defun-allowed> But I use a fair few global variables in my work, mostly to put weak hash tables somewhere, so that I can de-duplicate objects I use.
<phoe> and use dynamic variables either for passing context information along your call stack, and almost only for that.
<sauvin> I tend to prefer passing parameters. Dynamic variables (in my other-language experience) are just another morass.
<sauvin> Just like globals.
<phoe> most of the time they are, but they also allow for nice functionalities
<phoe> (with-output-to-string (*standard-output*) ...) hijacks the output stream and returns everything that was printed as a string
<sauvin> Is that something like $string = sprintf ( ... ) ?
<phoe> (let ((*package* (find-package :keyword))) (prin1 x)) prints X with all symbols being fully qualified, so with all package prefixes
<phoe> sauvin: not exactly
<phoe> ... is allowed to be arbitrary code
<phoe> it can contain functions which call functions which call functions which print to standard output
<phoe> and, no, they aren't printing to standard output anymore; they're printing into the stream that collects stuff into a string
<oni-on-ion> just symbols
<sauvin> $string = sprintf ($fmt, $func1->($func2->($func3->($crap))));
jonatack has quit [Ping timeout: 260 seconds]
<sauvin> Not sure how much I'm looking forward to lisp's packages, modules and OO. :\
<phoe> (defun foo () (princ :asdf)) (with-output-to-string (*standard-output*) (princ :qwer) (foo) (princ :zxcv))
<no-defun-allowed> I am aware that Haskell (or GHC maybe, who can tell the difference) has dynamic binding, so they're not totally useless.
joshu has joined #lisp
<phoe> ;; => "QWERASDFZXCV"
<phoe> that's what it looks like in CL
<phoe> the function FOO prints to standard output
<no-defun-allowed> Packages and OOP in Lisp are pretty fun.
<phoe> so we redirect the standard output elsewhere in code that calls FOO, and that works
Colleen has quit [Remote host closed the connection]
jonatack has joined #lisp
jonatack has quit [Client Quit]
heisig has joined #lisp
<no-defun-allowed> If you think you aren't going to have fun learning something, it is going to be hard to have fun learning it.
* beach keeps his thoughts to himself.
makomo has joined #lisp
<no-defun-allowed> At the very least, objects in Common Lisp are very different to that in other languages, such as Java and C++, and even different to that in the "real OOP" languages like Smalltalk and Self.
<no-defun-allowed> So past struggles in those paradigms may or may not be representative of one's use of CLOS.
scymtym has joined #lisp
frost-lab has quit [Quit: Connection closed]
joshu has quit [Remote host closed the connection]
jonatack has joined #lisp
vaporatorius has quit [Ping timeout: 256 seconds]
_whitelogger has joined #lisp
jonatack has quit [Ping timeout: 264 seconds]
Colleen has joined #lisp
jonatack has joined #lisp
Colleen has joined #lisp
Colleen has quit [Remote host closed the connection]
Colleen has joined #lisp
Colleen has quit [Remote host closed the connection]
SpaceIgor2075 has joined #lisp
vegansbane6 has quit [Quit: The Lounge - https://thelounge.chat]
v88m has quit [Ping timeout: 240 seconds]
jonatack has quit [Quit: jonatack]
okflo has joined #lisp
jonatack has joined #lisp
chrisb has left #lisp [#lisp]
Lycurgus has quit [Quit: Exeunt]
Colleen has joined #lisp
nostoi has quit [Quit: Verlassend]
igemnace has joined #lisp
igemnace has quit [Client Quit]
Colleen has joined #lisp
Colleen has quit [Remote host closed the connection]
beach has quit [Remote host closed the connection]
Colleen has joined #lisp
Colleen has quit [Remote host closed the connection]
skapata has quit [Remote host closed the connection]
beach has joined #lisp
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
vegansbane6 has joined #lisp
random-nick has joined #lisp
frodef` has joined #lisp
dhil has joined #lisp
shifty has joined #lisp
frodef has quit [Ping timeout: 272 seconds]
Colleen has joined #lisp
hiroaki has quit [Remote host closed the connection]
contrapunctus has left #lisp ["Disconnected: closed"]
Colleen has joined #lisp
Colleen has quit [Remote host closed the connection]
edgar-rft has joined #lisp
hiroaki has joined #lisp
frgo has quit [Remote host closed the connection]
refpga has quit [Ping timeout: 264 seconds]
frgo has joined #lisp
refpga has joined #lisp
Colleen has joined #lisp
Colleen has quit [Remote host closed the connection]
liberliver has joined #lisp
contrapunctus has joined #lisp
Colleen has joined #lisp
liberliver has quit [Client Quit]
surabax has joined #lisp
Colleen has joined #lisp
joshcom has joined #lisp
flazh1 has quit [Ping timeout: 260 seconds]
flazh1 has joined #lisp
kaftejiman has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
contrapunctus has joined #lisp
contrapunctus has left #lisp ["Disconnected: closed"]
ralt has joined #lisp
contrapunctus has joined #lisp
v_m_v has quit [Remote host closed the connection]
<heisig> If I had a nickel for every bug I introduced because I closed over a LOOP variable, thinking it would create a fresh closure for each iteration, I'd have have two nickels. Which isn't a lot, but it's weird that it happened twice.
generationhex has joined #lisp
surabax_ has joined #lisp
surabax has quit [Ping timeout: 260 seconds]
joshcom has quit [Quit: Leaving]
Bike has joined #lisp
lucasb has joined #lisp
surabax_ is now known as surabax
orivej has quit [Ping timeout: 246 seconds]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
mrios22 has left #lisp ["ERC (IRC client for Emacs 26.3)"]
isBEKaml has joined #lisp
mrios22 has joined #lisp
Colleen has quit [Quit: Colleen]
Colleen has joined #lisp
sauvin has quit [Ping timeout: 256 seconds]
oxum has quit [Quit: Leaving...]
shka_ has quit [Quit: Konversation terminated!]
shka_ has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
frodef` has quit [Ping timeout: 264 seconds]
amb007 has quit [Read error: Connection reset by peer]
hiroaki has quit [Ping timeout: 268 seconds]
amb007 has joined #lisp
luckless has quit [Remote host closed the connection]
xsperry has joined #lisp
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
gareppa has joined #lisp
gareppa has quit [Remote host closed the connection]
failproofshark has joined #lisp
rumbler31 has joined #lisp
pfdietz has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
rumbler31 has quit [Ping timeout: 264 seconds]
shifty has joined #lisp
waleee-cl has joined #lisp
frodef` has joined #lisp
v_m_v has joined #lisp
generationhex has quit []
notzmv has joined #lisp
refpga has quit [Read error: Connection reset by peer]
refpga has joined #lisp
shifty has quit [Ping timeout: 272 seconds]
makomo has quit [Ping timeout: 264 seconds]
v88m has joined #lisp
bitmapper has joined #lisp
isBEKaml has quit [Quit: leaving]
ralt has quit [Quit: Connection closed for inactivity]
<pfdietz> phoe: this is exercising the mutation tester, sanding off rough spots exposed by applying it to "real" code.
<phoe> pfdietz: yes, I have guessed
<phoe> thanks for the PR!
frodef` has quit [Ping timeout: 264 seconds]
<phoe> how are other projects faring in comparison?
<pfdietz> Just starting this round. split-sequence looks good, no real bugs found so far, just some cleanliness tweaking.
<phoe> was the (unless (<= start end) ...) a bug though?
<pfdietz> Well, ok, one bug.
<phoe> yes
<phoe> (split-sequence:split-sequence 0 (list 1 0 2 0 3 0 4) :start 2 :end 0) is capable of blowing the heap
<pfdietz> I applied it to fset sometime last year and found a number of problems, even in code that had been covered.
KREYREN has quit [Remote host closed the connection]
ech has quit [Write error: Connection reset by peer]
cantstanya has quit [Write error: Connection reset by peer]
madage has quit [Write error: Connection reset by peer]
gxt has quit [Write error: Connection reset by peer]
Aurora_v_kosmose has quit [Write error: Connection reset by peer]
<pfdietz> But, as I said, this is more for shaking down the tester. I'm going to have a set of recommendations for testing framework writers too, to make their tests more useful here.
<pfdietz> For example: an option to stop testing as soon as one failure is detected.
<phoe> yes, this sounds very nice
<phoe> so the issue can be fixed and then more fuzzing can happen
<phoe> so unnecessary duplicates don't happen.
gko_ has quit [Ping timeout: 256 seconds]
<pfdietz> In this case, because once I kill a mutant I want to stop testing. No sense killing it again and again.
<phoe> yes
<pfdietz> Also, I would like to be able to extract a subset of a test suite (say, just the tests that somewhere call function FOO) and just run those. No sense running tests that don't touch a mutated function.
<phoe> oh! can you do that automatically? tree-walking? code-walking?
<pfdietz> It's easy to see which tests call FOO: instrument FOO, run the test suite. This assumes the tests have set some special variable that indicates which individual test is being run.
<pfdietz> (setf (symbol-function 'foo) (instrument-it (symbol-function 'foo)))
<phoe> I assume you also could try to call Dissect and figure that out from the call stack, somehow... but, yes
ralt has joined #lisp
ech has joined #lisp
gxt has joined #lisp
<pfdietz> Not sure that would work on generic functions, though. Maybe an around method, but what if one already exists.
Aurora_v_kosmose has joined #lisp
cantstanya has joined #lisp
Aurora_v_kosmose has quit [Remote host closed the connection]
Aurora_v_kosmose has joined #lisp
madage has joined #lisp
<phoe> why wouldn't it work?
<_death> with such a who-calls database (kinda like screamer maintains) you could have relevant tests running automatically after redefining a function..
<phoe> I assume you can always SETF FDEFINITION with some sorta funcallable instance that then calls the original FDEFINITION
<phoe> or even with a closure that rebinds a variable and calls the closed-over function.
<pfdietz> Suppose the code dynamically adds new methods?
<pfdietz> No big deal though; in those cases just conservatively run all the tests.
<phoe> oh, yes, I see
luckless has joined #lisp
Krystof has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 240 seconds]
__jrjsmrtn__ has joined #lisp
<_death> sbcl has sb-introspect and others have their own interfaces (and then there's xref.lisp).. (swank:xref :callers "foo:bar") seems to work, but not a very convenient interface for CL programs
lotuseater has joined #lisp
<pfdietz> Anyway, what I was aiming for here was API in test frameworks to make this useful (running subsets of test, and knowing which test is running).
refpga has quit [Remote host closed the connection]
refpga has joined #lisp
refpga has quit [Read error: Connection reset by peer]
renzhi has joined #lisp
orivej has joined #lisp
Colleen has quit [Quit: Colleen]
Colleen has joined #lisp
cantstanya has quit [Ping timeout: 240 seconds]
cantstanya has joined #lisp
frodef` has joined #lisp
failproofshark has quit [Quit: Lost terminal]
makomo has joined #lisp
frodef` has quit [Ping timeout: 264 seconds]
saganman has quit [Quit: WeeChat 1.6]
skapata has joined #lisp
<_death> with a little patching the slime xref browser now works reasonably on sbcl
renzhi has quit [Ping timeout: 264 seconds]
vutral has joined #lisp
Colleen has quit [Quit: Colleen]
<Xach> oh lord, local-time is broken?
<Xach> sbcl strikes again
luckless has quit [Quit: luckless]
Colleen has joined #lisp
luckless has joined #lisp
<Xach> i don't quite understand the location of the warning from http://report.quicklisp.org/2021-01-03/failure-report/local-time.html#local-time
<Xach> ah, i see
<_death> yeah.. looks like it tries to dolist on a vector
<aeth> A fun error I've been getting is when SBCL 2.0.2 (in e.g. Gitlab CI) STYLE-WARNINGs that the implicit return value of NIL in a COND with no default clause is not of some numeric type that the rest of the code expects. But SBCL 2.0.8, which I actually use (and yes, I should upgrade), is a bit smarter and complains about deleting unreachable code in those unreachable, literally-impossible default branches.
Nilby has joined #lisp
hiroaki has joined #lisp
<aeth> I suppose I should have an EFOO and CFOO version (like ECASE and CCASE) to those macros that generate CONDs so that the default branch is an error instead, since if you make it an error, it won't complain... except about deleting unreachable code, which can be safely hidden in a "(LOCALLY (DECLARE #+SBCL" with the right declaration.
<pfdietz> Turn the last clause (<condition> . <forms>) into (t (assert <condition>) . <forms>)?
orivej has quit [Ping timeout: 264 seconds]
* Xach file bug
<phoe> SBCL: the greatest bane of lisp programmers and maintainers since CMU CL
<pfdietz> I plan to use these warnings in the mutation tester. If I want to substitute Y for X, I can insert a (unless (eql x y) ...) and if it complains about unreachable code, I know that's an equivalent mutant.
<phoe> if you enjoy lisp compilers that don't yell at you for things, you definitely shouldn't try sbcl
<Nilby> Is there way to get sldb to automatically keep picking a restart?
<phoe> automatically? like, in a loop?
<Nilby> Yes, like next time it gets the same error.
<phoe> I'd do that with handler-bind over invoke-restart around the signaling form in the REPL
<phoe> but I don't know a SLDB solution, it any
hiroaki has quit [Ping timeout: 272 seconds]
<Nilby> Hmmm. I was hoping to do in without forethought. Like an easy way to blast through encoding errors.
orivej has joined #lisp
<phoe> handler-bind over invoke-restart sounds the best for me
<SpaceIgor2075> I finished reading A Complete Idiot's Guide to Common Lisp Packages and I feel like an incomplete idiot
<Nilby> phoe: Thanks.
rogersm has joined #lisp
<SpaceIgor2075> So, to make a new package, in newpackage.lisp I should write something like: (defpackage newpackage :export '("new-stuff")) (in-package newpackage) (defun newstuff () "New Stuff!!")
<SpaceIgor2075> Did I get it right?
jurov has joined #lisp
jurov_ has quit [Ping timeout: 265 seconds]
Jeanne-Kamikaze has joined #lisp
izh_ has joined #lisp
sauvin has joined #lisp
mindCrime has joined #lisp
notzmv has quit [Read error: No route to host]
notzmv has joined #lisp
<Nilby> SpaceIgor2075: pretty close, but I would say: (defpackage :newpackage (:use :cl) (:export #:new-stuff)) (in-package :newpackage)
<phoe> SpaceIgor2075: DEFPACKAGE options are not quoted, and remember that strings respect case whereas symbols, by default, don't
izh_ has quit [Quit: Leaving]
sauvin has quit [Read error: Connection reset by peer]
hendursaga has joined #lisp
sauvin has joined #lisp
hnOsmium0001 has joined #lisp
<SpaceIgor2075> phoe: 1. why is :cl used instead of 'cl? 2. (:export #:new-stuff) has a # because new-stuff is a function, am i right?
<phoe> SpaceIgor2075: actually the answer to both questions is one and the same
<phoe> because of how Lisp works, the reader works before code is compiled
<phoe> and writing FOO causes the reader to intern the symbol named "FOO" in the current package
<phoe> when you evaluate a DEFPACKAGE, this can happen in literally any package, because usually only after a package is defined you use IN-PACKAGE to switch into it
<phoe> so a DEFPACKAGE form that has unqualified symbols like FOO in it can intern unnecessary symbols into other packages.
<phoe> so there are three ways to fix this issue
<phoe> 1) :foo 2) #:foo 3) "FOO"
<phoe> option 1) is to use keywords, which interns symbols into the KEYWORD package
<phoe> which kiiinda sidesteps the problem but not really, because now symbols are interned into the KEYWORD package, which can produce unnecessary keywords
bluejaypop has joined #lisp
<phoe> option 3) is to use strings, which is permissible, but has issues if someone uses a different readtable case than the standard, upcasing one
<phoe> option 2) is to use packageless symbols, which are interned nowhere
<phoe> and I personally suggest to use #:foo for everything in DEFPACKAGE, including imports and uses and exports and package-local nicknames
<phoe> so (defpackage #:newpackage (:use #:cl) (:export #:new-stuff)) (in-package #:newpackage)
<SpaceIgor2075> phoe: thanks. So, #:stuff is equivalent to (make-symbol "STUFF")?
<Nilby> phoe is such a great explainer, maybe should write a book. ;-)
<phoe> SpaceIgor2075: almost equivalent
<phoe> it's equivalent to #.(make-symbol "STUFF")
<phoe> the #. denotes that it's done at read-time
<phoe> Nilby: :(
<phoe> again? come on
<sauvin> What book did you write?
<SpaceIgor2075> phoe: What's the name of the book?
<_death> An Incomplete Idiot's Guide To CL Packages
<phoe> _death: I burst into laughter, thank you
<phoe> minion: tell sauvin about tclcs
<minion> Sorry, I couldn't find anything in the database for ``tclcs''.
<phoe> >:(
<sauvin> tcl!?
* sauvin runs away
<SpaceIgor2075> tclhs?
<phoe> minion: tell sauvin about tclcs
<minion> sauvin: tclcs: The Common Lisp Condition System, https://www.apress.com/us/book/9781484261330
<phoe> there
<sauvin> Bookmarked. When I understand lisp a little better, I gonna grab that book.
<phoe> thanks, hope that it serves you well
<phoe> it seems that I've achieved two things with this book, one intended, one accidental
<SpaceIgor2075> CL seems to be quite deep. Are there any books dedicated to other programming languages' condition systems?
<phoe> the intended one was to write about the ideas, implementation, and use cases of the condition system
<SpaceIgor2075> Or is it specific to CL that you can write a whole book on it's condition system?
<phoe> the accidental one: I seem to have described how to implement a non-trivial piece of Common Lisp code, bit by bit, while testing it heavily in the REPL
<phoe> SpaceIgor2075: other languages don't have condition systems in general
<phoe> their exception handling routines are usually simpler, much simpler
<phoe> one of my online lisp talks describes this a little
<Nilby> If we just copy the irc logs and throw a few headings on, i feel like we'd have like 2 more phoe books pretty quick.
lucasb has quit [Quit: Connection closed for inactivity]
<sauvin> What, in a nutshell, _is_ the condition system?
<SpaceIgor2075> Nilby: phoe may have a blog
v_m_v has quit [Remote host closed the connection]
v_m_v has joined #lisp
<phoe> sauvin: a system of handling special situations happening in code, including errors
<phoe> SpaceIgor2075: I do have a blog but it's not really populated
<phoe> that idea of scraping IRC logs does sound kinda nice, when I think about it...
<sauvin> I should imagine that if the S/N ratio here is high enough, browsing the logs would be a great tool for brainstorming all KINDS of random stuff.
<phoe> #lisp is moderated rather heavily when it comes to off-topic discussion, so S/N should be high in general
bilal_ has quit [Quit: Leaving]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Colleen has quit [Quit: Colleen]
aeth has quit [Ping timeout: 260 seconds]
aeth has joined #lisp
vaporatorius__ has joined #lisp
<SpaceIgor2075> Where can i learn about projects and asdf? When I create a project with quickproject i get a dir with project.asd project.lisp package.lisp; i want to know what's going on
vaporatorius has quit [Ping timeout: 264 seconds]
Colleen has joined #lisp
andreyorst has quit [Read error: Connection reset by peer]
Nilby has quit [Read error: Connection reset by peer]
contrapunctus has left #lisp ["Disconnected: Replaced by new connection"]
contrapunctus has joined #lisp
birdwing has quit [Ping timeout: 268 seconds]
<SpaceIgor2075> Is CLtL2 worth reading for a newbie who read LoL?
lalilulelo has joined #lisp
andreyorst has joined #lisp
<_death> yes
<phoe> LoL, you mean Land of Lisp?
<_death> just keep in mind that there are a few changes in the standard
contrapunctus has left #lisp ["Disconnected: closed"]
<phoe> asking because Let over Lambda is not really for newbies, if that's what you read
rogersm has quit [Quit: Leaving...]
vutral has quit [Quit: Connection closed for inactivity]
<SpaceIgor2075> Land of Lisp, but i was planning to read Let over Lambda
<SpaceIgor2075> (Lisp needs more LoLbooks)
<SpaceIgor2075> _death: really, they changed the standsrd? I thought CL didn't change for decades
contrapunctus has joined #lisp
<_death> SpaceIgor2075: CLtL2 was written as the language was standardized
<_death> SpaceIgor2075: in fact for a newbie, it may be better to first read a book like Practical Common Lisp first
<phoe> importantly, CLtL2 was written before ANSI CL was finalized
luis has quit [Ping timeout: 240 seconds]
<SpaceIgor2075> phoe: Oh, now i get it. Is CLtL2 to ANSI CL like K&R C to ANSI C?
frodef` has joined #lisp
<_death> kind of, except K&R was a short guide and CLtL2 is more a sprawling creature that's between spec and guide
<_death> a manual..
IPmonger has joined #lisp
hiroaki has joined #lisp
matryoshka has quit [Quit: ZNC 1.8.2 - https://znc.in]
matryoshka has joined #lisp
junkicide has joined #lisp
matryoshka has quit [Client Quit]
<ralt> I really wish lisp implementations didn't depend so much on glibc
jeosol has quit [Remote host closed the connection]
rumbler31_ has joined #lisp
luis has joined #lisp
<heisig> ralt: The people in #sicl are working on it :)
ebrasca has joined #lisp
matryoshka has joined #lisp
heisig has quit [Ping timeout: 246 seconds]
shka_ has quit [Ping timeout: 256 seconds]
VincentVega has joined #lisp
<VincentVega> Guys, is the funcall version slower here, and if yes is there a way not to repeat arg, while retaining performance?
<VincentVega> (if b (f1 arg) (f2 arg))
<VincentVega> (funcall (if b 'f1 'f2) arg)
<phoe> the two should be equivalent performancewise on a smart enough compiler
<phoe> try comparing disassemblies
<VincentVega> i see, ok!
bluejaypop has left #lisp ["The Lounge - https://thelounge.chat"]
cosimone has joined #lisp
mankaev has joined #lisp
mankaev has quit [Client Quit]
mankaev has joined #lisp
andreyorst has quit [Remote host closed the connection]
<phoe> does anyone know of an automated test suite for Flavors?
Colleen has quit [Quit: Colleen]
mankaev_ has quit [Quit: ZNC 1.7.4 - https://znc.in]
Colleen has joined #lisp
adam4567 has joined #lisp
andreyorst has joined #lisp
hiroaki has quit [Ping timeout: 246 seconds]
abhixec has joined #lisp
junkicide has quit [Ping timeout: 265 seconds]
v88m has quit [Ping timeout: 272 seconds]
rumbler31_ has quit [Ping timeout: 264 seconds]
sloanr has joined #lisp
mindCrime has quit [Ping timeout: 264 seconds]
luis has quit [Ping timeout: 265 seconds]
rumbler31_ has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
v88m has joined #lisp
<scymtym> fiddlerwoaroof: if you like linedit, would this be interesting for you: https://techfak.de/~jmoringe/linedit-1.ogv
<phoe> is this another show of eclector wizardry that you are performing in front of us now?
<phoe> I'm asking because I'm amazed
cg505- has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
hendursaga has quit [Ping timeout: 240 seconds]
cg505 has joined #lisp
hendursaga has joined #lisp
TMA has joined #lisp
<scymtym> phoe: yes, eclector-based highlighting. more or less the same thing that did the highlighting in the eclector presentation
<phoe> scymtym: :D
Colleen has quit [Quit: Colleen]
luckless has quit [Quit: luckless]
luckless has joined #lisp
luna_is_here has quit [Ping timeout: 272 seconds]
luna_is_here has joined #lisp
narimiran has quit [Ping timeout: 264 seconds]
cosimone has quit [Quit: cosimone]
luis has joined #lisp
<markasoftware> Is there any sort of library with more powerful generic functions? I want to be able to specialize on arbitrary conditions and on the current state of global variables
<phoe> conditions, what do you mean?
<phoe> you mean condition types? you already can do that, all CL implementations implement condition types as condition classes
<markasoftware> I mean it in the true or false sense lol
<phoe> oh; you can kinda already do that
<markasoftware> Eg, use this method if the argument is an odd numbet
<phoe> you can have a method specialized on NULL if you want to match NIL, and an unspecialized method for all other cases
<no-defun-allowed> T for true objects, NULL for false (NIL), but that won't do predicate dispatch.
<phoe> oh, like that... hmmm
<no-defun-allowed> I think there were a few papers on "generalisers" and predicate dispatch in CLOS and/or MOP.
<_death> there are libraries like contextl, filtered-functions, specializable, etc.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
v_m_v has quit [Remote host closed the connection]
amb007 has joined #lisp
GuerrillaMonkey has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
ym has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
Jeanne-Kamikaze has quit [Ping timeout: 256 seconds]
amb007 has joined #lisp
shifty has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
shifty has quit [Ping timeout: 264 seconds]
<markasoftware> Very interesting. I'm sure I can take some combination of these ideas to do what I want. Thanks everyone!
vaporatorius has joined #lisp
vaporatorius has quit [Changing host]
vaporatorius has joined #lisp
<aeth> Well, this is a first. I had to introduce an ECASE= variation of the CASE= macro so I could satisfy both old SBCL (like in Gitlab CI) and new SBCL (like on my local machine). https://gitlab.com/zombie-raptor/zombie-raptor/-/commit/12bb5cc21a185988b72f7cc4da118f4dd992a286
vaporatorius__ has quit [Ping timeout: 258 seconds]
<aeth> The default, impossible path is an error in old SBCLs (no warning that it's possibly a NIL) and deleted as unreachable code (but without a compiler note) in new SBCLs.
vaporatorius__ has joined #lisp
<aeth> I've had to work around different implementations before, but working around different actively-used SBCLs is... something else.
specbot has quit [Remote host closed the connection]
minion has quit [Remote host closed the connection]
vaporatorius has quit [Ping timeout: 256 seconds]
<Krystof> aeth: we may not move fast, but we break things
<Krystof> this is probably because case on small integer keys got an optimization a while back to convert to jump tables
<Krystof> I'm not entirely surprised that this causes a change in the diagnostics emitted
<aeth> Krystof: well, not case, but COND
<Krystof> if it's a cond that looks like the expansion of case, the same applies
<mfiano> posted yesterday about DCE without notes, and also DCE without retval checking
<aeth> And, yes, what happened is that it got smarter so that it was able to delete impossible branches
<aeth> Perhaps because of that optimization, yes
madage has quit [Ping timeout: 240 seconds]
rtoy has joined #lisp
Oddity- has joined #lisp
minion has joined #lisp
specbot has joined #lisp
mindCrime has joined #lisp
thmprover has joined #lisp
Oddity has quit [Ping timeout: 268 seconds]
madage has joined #lisp
okflo has quit [Remote host closed the connection]
luis has quit [Ping timeout: 260 seconds]
luis has joined #lisp
pve has quit [Quit: leaving]
karlosz has joined #lisp
asarch has joined #lisp
<asarch> One very stupid question: once you have defined your new class *without* any accessor at all, e.g.: (defclass foo () ((bar :initform nil :initarg :bar))), can you later with inheritance define an accessor? In this case, an accessor for bar: (defclass spam (foo) ...)?
SpaceIgor2075 has quit [Read error: Connection reset by peer]
<asarch> *once you have defined your class with a slot...
SpaceIgor2075 has joined #lisp
<no-defun-allowed> Yes, but it's probably wiser to start with defining an accessor.
<phoe> asarch: yes, you need to duplicate the slot form and add an accessor there
<phoe> this accessor won't work for the superclass if you do it this way.
<asarch> Or you have to (defgeneric bar ((spam))), (defmethod (setf bar) ((instance spam))), (defmethod bar ((instance spam)) ...)?
rumbler31_ has quit [Ping timeout: 265 seconds]
<phoe> not needed - but, again, this way is not really advised unless you have some use case for that
<phoe> also you can't specialize in defgeneric
<phoe> so, no double parens around spam
<asarch> But, (defmethod (setf bar) ((instance spam) value) (setf (slot-value 'bar) value)), right?
jeosol has joined #lisp
<phoe> yes
<asarch> I mean, that was the "short" version
<_death> asarch: the value comes first
rumbler31_ has joined #lisp
SpaceIgor2075 has quit [Remote host closed the connection]
<phoe> _death: oh right, good catch
<asarch> Yeah, sorry, my mistake
VincentVega has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 264 seconds]
<asarch> So, 1) redefining the slot in the inherited class or 2) (defgeneric ...) and then (defmethod ...), right?
<phoe> yes, but this looks weird to me; why would you only define an accessor on a subclass?
<asarch> Do you know the GTK+ widget library?
<phoe> yes, I do
<phoe> I mean, I have heard of it, and used it in multiple applications, but not as a programmer
<asarch> Well, in the Glade template you have a GtkTextView and to set the text you would need to:
<asarch> (defmethod content ((instance editor))
<asarch> (let ((buffer (gtk-text-view-get-buffer (slot-value instance 'content))
<asarch> start-iter end-iter)
<asarch> (setf start-iter (gtk-text-buffer-get-start-iter buffer))
<phoe> asarch: mind using a pastebin?
<asarch> And so one
<asarch> *so on
<asarch> Sorry
<asarch> If I would have content as slot value I couldn't do later: (setf (content instance) "blaaa")
<asarch> I mean, as an accessor
<phoe> the editor does not have an accessor for its content slot?
<asarch> However, in order to abstract some operations, in the super class I just need it
<asarch> Yeah
<phoe> why?
<asarch> ...without any accessor at all
<asarch> Well, that was the solution I found :'-(
<phoe> which library for accessing GTK are you using?
<asarch> For every widget in the dialog in the Glade template, there is a slot value in the class that wraps its operation
<asarch> cl-cffi-gtk
<phoe> so this library only exposes slots as its standard interface, and does not provide accessors?
<asarch> This library only provides C "primitives" functions like (setf (gtk-dialog-title my-dialog) "Hello, folks!")
<asarch> So, if in the dialog there is a widget a la "Name: [_____________]" in the class that wraps it I could have a slot (name :initarg :name :initform nil) and then later I could set its initial handler with (setf (slot-value 'dialog name) (gtk-builder-get-object builder "name"))
shifty has joined #lisp
<asarch> So later with (defgeneric ...) and (defmethod ...) I could use it, e.g., to store its value in the model of the application: (add-data model (name dialog)) by doing the GTK+ primitives operations to extract the data from the widget
<phoe> yes, I see
<phoe> if it only exposes slots, I assume you could then depend on this behavior - and define your own generic function on the superclass
<asarch> So I could write an "abstract" base class for this dialog to re-use it in later applications
<phoe> (defmethod my-package:my-wrapper ((editor gtk:editor)) (slot-value editor 'gtk:contents))
<phoe> something like that
<phoe> and then use your GF
<phoe> this isn't C++, you can define new generic functions or methods on already existing classes
<asarch> I see
<asarch> Is there a book for pattern solutions in Common Lisp?
<phoe> probably Common Lisp Recipes, maybe
<phoe> it's less about patterns and more about tips and tricks though
fixing_auth_hold has joined #lisp
<asarch> CLOS is wonderful! It takes you one step far and beyond the rest
<asarch> How could you know the statistics of SBCL REPL (memory available, uptime, etc)?
lalilulelo has quit [Ping timeout: 260 seconds]
<phoe> memory: CL:ROOM
<phoe> uptime: query the OS possibly, or get-internal-run-time
<asarch> Thank you!
<asarch> I miss the book of Pattern Designs for Smalltalk... :'-(
<no-defun-allowed> Design patterns are mostly unnecessary in Common Lisp.
<no-defun-allowed> Norving claims 16 of 23 patterns from the book are much simpler in Common Lisp or Dylan <https://norvig.com/design-patterns/design-patterns.pdf>
<asarch> What would be the best solution for that in Common Lisp? Macros?
<phoe> not always
<phoe> some of them are simply built into the language
<phoe> like the visitor pattern versus :before/:after/:around methods
<no-defun-allowed> The presentation describes a few replacements.
<scymtym> also, when people say "design patterns", they often mean design patterns in the context of object oriented design which has assigning responsibilities in the form of methods to classes at its cores. since common lisp classes don't have any associated behavior, the approach does not translate very well
<phoe> ^
<no-defun-allowed> Slide 10 tells us gains are achieved mostly with first-class types, then first-class functions, then macros, then method combination, multiple dispatch and modules.
<asarch> However, Common Lisp actually does everything (almost) with macros, doesn't it? Even (defclass ...) is a macross, isn't it? (accordingly with The Art of the Meta-Object Protocol book)
<phoe> no
<asarch> No?
<phoe> DEFCLASS is a macro, but you can equivalently call ENSURE-CLASS which is not a macro
<no-defun-allowed> Maybe, but most of the patterns can be solved with already existing syntax and forms.
<phoe> it's a function! and actually DEFCLASS, if you read the MOP, should expand into a call to ENSURE-CLASS
<phoe> the macro is just for nicer syntax and some compile-time trickery and compile-time validation.
<no-defun-allowed> Specifically, using first-class types and functions, and method combination and multiple dispatch, which are a property of generic functions.
<scymtym> special variables also solve some of the problems of parametrizing behavior or "injecting dependencies"
<asarch> Is a meta-object protocol the same as a pattern design?
<phoe> oh yes, java's famous Context and Dependency Injection (CDI), also known in lisp as dynamic variables
mrcom has joined #lisp
<phoe> asarch: nope, MOP describes how CLOS is implemented and works under the hood
<asarch> However, you could also have your own MOP just like Perl via Moose has it, right?
<phoe> I have no idea what Moose is or how it does things
Oladon has joined #lisp
<no-defun-allowed> Moose is built on Class::MOP, which is already in Perl.
frodef` has quit [Ping timeout: 246 seconds]
<asarch> That is not a "pattern design", right?
<phoe> not really
<_death> you could describe common solutions to problems as patterns the way the gang of four book describes them (problem statement, forces or constraints, implementation issues, etc.)
<phoe> metaobject protocols are about tweaking the object systems
<phoe> patterns are... what _death said
<no-defun-allowed> I use the metaobject protocol to attach additional information to classes and instances, to change how instances are allocated, and things like that. Design patterns are what you do with instances.
<asarch> I see
<mfiano> design patterns are purported master programming advice passed on to unsuspecting novices in languages without macros
<asarch> One is consequence of another
<no-defun-allowed> But it's not only macros. And all of them could be done without a meta-object protocol.
<scymtym> implementing a WITH-FOO macro as a function CALL-WITH-FOO and a minimal expander (with-foo (…) BODY) → (call-with-foo (lambda (…) BODY)) could be a proper common lisp pattern in the sense _death mentioned. the problem is too avoid code bloat and allow some redefinition of the macro's behavior without recompiling all uses
<_death> the AMOP book says it presents a particular MOP (for CLOS), but that the idea could be implemented for other (possibly non-Lisp) object systems.. so it's possible to imagine a Metaobject Protocol language design pattern
<asarch> One step further and beyond...
<scymtym> regarding AMOP, ENSURE-THING-USING-THING could be considered a design pattern for creating and updating bindings in an environment
<_death> then there are obvious architectural patterns like (rule) Production system or Blackboard system..
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
v88m has quit [Ping timeout: 260 seconds]
sloanr` has joined #lisp