<drmeister>
Thank you - I have to run to catch a train. I'll look through this then.
<pjb>
Have fun!
ebrasca has joined #lisp
aautcsh has quit [Ping timeout: 252 seconds]
aoeu256 has quit [Read error: Connection reset by peer]
aoeu256 has joined #lisp
sonologico has quit [Remote host closed the connection]
lucasb has quit [Quit: Connection closed for inactivity]
wigust- has joined #lisp
wigust has quit [Ping timeout: 245 seconds]
aoeu512 has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
aoeu256 has quit [Ping timeout: 258 seconds]
<remexre>
is there a "really good"/"community standard" parsing library? (e.g. parsec for haskell, antlr for java)
<remexre>
alternatively, what would people recommend for parsing "scanf data," i.e. data in a format made to be parsed w/ scanf (i.e. line-based, no nesting, clear separators, etc)
aoeu256 has joined #lisp
aoeu512 has quit [Ping timeout: 258 seconds]
t58 has quit [Quit: Leaving]
<ebrasca>
remexre: you can load lisp data from text files and write it to files.
semz has quit [Ping timeout: 264 seconds]
aoeu256 has quit [Ping timeout: 248 seconds]
Kaisyu_ has quit []
Kaisyu has joined #lisp
<remexre>
Pq
<remexre>
Whoops, phone
<remexre>
Sure, but what gets it from the format I already have to s-exprs :)
<remexre>
ebrasca: ^^
* no-defun-allowed
is partial to parser-combinators (which is the same theory as Parsec), but has only really worked with cl-yacc which is a little more y[au]c[ck]y
<remexre>
Lol
anewuser has joined #lisp
q9929t has quit [Quit: q9929t]
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
Oladon_wfh has quit [Ping timeout: 260 seconds]
malaclyps[m] has joined #lisp
orivej has joined #lisp
<ebrasca>
remexre: maybe (load path-to-file")
Achylles has quit [Ping timeout: 252 seconds]
<remexre>
ebrasca: the existing format I need to work with isn't s-expressions
EvW has quit [Ping timeout: 264 seconds]
<ebrasca>
remexre: I don't know one.
sonologico has joined #lisp
superkumasan has joined #lisp
saravia has quit [Remote host closed the connection]
dale has quit [Read error: Connection reset by peer]
dale has joined #lisp
dale has quit [Client Quit]
dale has joined #lisp
<sjl>
smug is okay if you want parser combinators. other folks seem to like esrap (I've never used it).
Bike has quit [Quit: Lost terminal]
<sjl>
I don't think there's one single library that everyone uses, like in the languages you mentioned
milanj has joined #lisp
notzmv has joined #lisp
shrdlu68 has joined #lisp
techquila has quit [Remote host closed the connection]
<drmeister>
remexre: We use esrap for all of our parser needs in the Cando project.
<drmeister>
I think we have three or four parsers now?
<remexre>
Huh, I'll give it a try ig
<drmeister>
We have some pretty exotic grammars to parse - it is industrial strength.
shrdlu68 has quit [Ping timeout: 245 seconds]
dddddd has quit [Read error: Connection reset by peer]
<beach>
Good morning everyone!
torbo has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 245 seconds]
liberiga has quit [Ping timeout: 260 seconds]
lalitmee has joined #lisp
gravicappa has joined #lisp
ssake has quit [Ping timeout: 245 seconds]
dale has quit [Quit: My computer has gone to sleep]
nanoz has joined #lisp
shrdlu68 has joined #lisp
Necktwi has quit [Ping timeout: 245 seconds]
milanj has quit [Quit: This computer has gone to sleep]
<beach>
remexre: That Common Lisp HyperSpec page is for you.
<remexre>
okay so it's just simultaneous assignment, not anything wacky with ASCII art?
<remexre>
I guess sorta XY problem for why I'm digging in swank -- my program's got a (CPU-bound) main loop, and I wanna integrate a SWANK check in it; right now, I'm doing (loop for c in swank::*connections* do (swank::handle-requests c t))
<remexre>
after (swank:create-server :style :fd-handler :dont-close t) at the top of the loop
<remexre>
but it has trouble picking up on new connections
<remexre>
is there something I need to call to get that to work?
<remexre>
(this is all cobbled together from scraps of non-working code I've found, so if this is completely the wrong way to do this, I'm more than willing to accept that :P)
shrdlu68 has quit [Ping timeout: 245 seconds]
sonologico has quit [Remote host closed the connection]
lalitmee has quit [Remote host closed the connection]
ggole has joined #lisp
<stylewarning>
Does ADJUST-ARRAY (to a smaller dimension) allow Lisp to reclaim memory in any implementations?
<LdBeth>
how to call a base method of a parent class without invoke the :after method?
lalitmee has joined #lisp
<stylewarning>
LdBeth: (call-next-method)
lalitmee has quit [Max SendQ exceeded]
<stylewarning>
LdBeth: (unless I am misunedrstanding what you
<stylewarning>
re saying)
<LdBeth>
stylewarning: I mean without invoke the :after method of that base method of parent class
hiroaki has quit [Ping timeout: 258 seconds]
lalitmee has joined #lisp
<stylewarning>
LdBeth: Ok, I misunderstood. I'm not sure without dynamically computing it; sounds like a code smell.
<refreshing_drink>
If you want to include 'else' in your conditioning, what do you use?
<LdBeth>
While Common Lisp has to keep compatible with some old fashioned lisps
<stylewarning>
refreshing_drink: t
<refreshing_drink>
o_o
<stylewarning>
the boolean that's never false (:
<refreshing_drink>
A little unexpected, but works for me!
<stylewarning>
isn't it more expected than some random keyword?
<stylewarning>
(cond (bool1 exp1) (bool2 exp2) ... (booln expn)) ; just let booln = T
<refreshing_drink>
probably not, coming from a background where it has been provided in other languages :p
<LdBeth>
Don’t assume you know Common Lisp while you already knows Scheme
<LdBeth>
Vise versa
<stylewarning>
refreshing_drink: in scheme, you could also do (cond ... (#t ...)), it would just look odd and unidiomatic
<refreshing_drink>
:o
ravenous_ has joined #lisp
mathrick has quit [Ping timeout: 276 seconds]
ltriant has quit [Quit: leaving]
ravenous_ has quit [Ping timeout: 252 seconds]
flamebeard has joined #lisp
mathrick has joined #lisp
shrdlu68 has quit [Ping timeout: 248 seconds]
gko has quit [Remote host closed the connection]
gigetoo has quit [Ping timeout: 248 seconds]
orivej has joined #lisp
gioyik has joined #lisp
gigetoo has joined #lisp
anewuser has quit [Quit: anewuser]
shrdlu68 has joined #lisp
nanoz has joined #lisp
gioyik has quit [Quit: WeeChat 2.5]
scymtym has joined #lisp
knicklux has quit [Remote host closed the connection]
lalitmee has quit [Ping timeout: 244 seconds]
jprajzne has joined #lisp
froggey has quit [Ping timeout: 258 seconds]
froggey has joined #lisp
vlatkoB has joined #lisp
nanoz has quit [Ping timeout: 244 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
makomo_ has joined #lisp
lalitmee has joined #lisp
heisig has joined #lisp
Necktwi has joined #lisp
milanj has joined #lisp
karlosz has joined #lisp
Insanity_ has joined #lisp
karlosz has quit [Quit: karlosz]
ljavorsk has joined #lisp
<ljavorsk>
Hi everyone, I'm working on maintaining pgloader for Fedora, and there is sbcl required. It is needed for build, but it uses this .lisp script where it downloads a bunch of files from network, but in mock build it crashes on error because of no connection. Did anyone had this problem? And what was your next steps? I've downloaded those files, and considering to make a tarball of them, but is it the best option for it? Thanks for help
<pjb>
refreshing_drink: note, you might want to (defconstant otherwise t) too, to be consistent with (case 0 (1 'nope) (otherwise 'yep)) #| --> yep |# (cond ((= 0 1) 'nope) (otherwise 'yep)) #| --> yep |#
<flip214>
pjb: shouldn't that be +else+? That would destroy the whole point, though! So perhaps we should have ++ on the other special operators as well - +if+, +cond+, etc.
<pjb>
flip214: yes, lipe pi should be +pi+
<flip214>
and most-positive-fixnum
JohnMS has joined #lisp
JohnMS_WORK has quit [Ping timeout: 246 seconds]
<flip214>
actually, CL21 should have (defconstant π cl:pi)
<jackdaniel>
and t should be +t+ ,-)
iskander has quit [Ping timeout: 245 seconds]
<jackdaniel>
then I could write functions with T as a time argument!
<refreshing_drink>
In the last condition of 't' for example.
milanj has joined #lisp
<jackdaniel>
your indentation is bad, I doubt many people will bother with reading code with such formatting
<refreshing_drink>
I thought 2 spaces was the way to go. :O
<refreshing_drink>
Is there a CL emacs style formatter?
<jackdaniel>
each argument to cond is a separate clause and all should be indented the same way
<refreshing_drink>
Ohhh so like starting the first one on a new line
<refreshing_drink>
gotcha
<jackdaniel>
there is, take a look at quicklisp.org which helps you to install slime (slime is an emacs mode for editing common lisp)
<jackdaniel>
minion: tell refreshing_drink about pcl
<minion>
refreshing_drink: please look at pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
<jackdaniel>
pcl also describes how to set up slime
<jackdaniel>
if you want something preconfigured take a look at portacle
<refreshing_drink>
i have slime installed
<jackdaniel>
minion: tell refreshing_drink about portacle
<minion>
refreshing_drink: portacle: Portacle is a complete IDE for Common Lisp that you can take with you on a USB stick https://shinmera.github.io/portacle/
<jackdaniel>
uhm
<refreshing_drink>
i was having a look at winston's book
<refreshing_drink>
but this is a cross-over of some old schole code to lisp
<refreshing_drink>
just for fun
<refreshing_drink>
s/lisp/common lisp
<refreshing_drink>
so if i have a cond with multiple conditions, and i want to have multiple statements on the last condition o_o
<refreshing_drink>
how do i habdle that
<jackdaniel>
just put them there
<jackdaniel>
cond has implicit progn for each clause
<jackdaniel>
(cond ((foo) a b c) (t x y z))
maxxcan has quit [Quit: maxxcan]
xkapastel has joined #lisp
<refreshing_drink>
i wonder why style-warning says the variable procedure is defined but never used
<refreshing_drink>
must be a difference in scoping rules in CL than scheme
<jackdaniel>
you define local functions with flet, not with defun
<jackdaniel>
or if they are recursive you use labels
<refreshing_drink>
oh nice
<jackdaniel>
there aren't many occasions when you really want to put defun in body of another function
esrse has quit [Ping timeout: 248 seconds]
<refreshing_drink>
hmm so flet doesn't allow for recursion
<jackdaniel>
yes, that's what labels is for
<refreshing_drink>
taking it over to #clnoobs
<refreshing_drink>
s/schole/scheme
iskander has quit [Read error: Connection timed out]
iskander has joined #lisp
maxxcan has joined #lisp
maxxcan has quit [Client Quit]
cosimone has joined #lisp
<pjb>
jackdaniel: that said, we don't lack T alternatives: ŢţŤťŦŧƬƭƮȚțʇʈΤτТҬҭṪṫṬṭṮṯṰṱẗ⒯ⓉⓣⷮꓔꓕꓝꓞꚌꚍꚐꚑTt𐊗𐋇𐌕
nanoz has quit [Read error: Connection timed out]
<pjb>
(I included a pair of F alternatives for false/nil)
<jackdaniel>
I'm too dumb to remember that same-looking characters make different symbol names
<jackdaniel>
so I'd find it hard to track after writing the code
nanoz has joined #lisp
<pjb>
jackdaniel: emacs has C-x = to give info about the character under the cursor.
cosimone has quit [Quit: Leaving]
<jackdaniel>
that gives only 13 keypresses to verify that foo is really foo, nice!
<pjb>
(defun v (Τ a v₀) (+ (* a Τ) v₀))
<refreshing_drink>
why did hoyte stop writing common lisp?
<pjb>
Oh, and also, I forgot, the various mathematical alphabets: 𝐭𝒕𝙩𝓉𝓽𝕥𝔱𝗍𝘁𝙩𝚝
<heisig>
pjb: I also have (defun δ (i j) (if (= i j) 1 0)).
<refreshing_drink>
also, since #clnoobs seems to be sleep
<refreshing_drink>
i'm wondering why the following code is complaining about 'skip' and 'procedure' being undefined functions:
<jackdaniel>
" (Nobody using pastel colors gets an A.) " :-)
tko has quit [Ping timeout: 276 seconds]
gigetoo has quit [Ping timeout: 268 seconds]
gigetoo has joined #lisp
ljavorsk has quit [Ping timeout: 258 seconds]
<gjvc>
lisp in small pieces looks like a great book
<jackdaniel>
it is
nanoz has quit [Read error: Connection reset by peer]
nanoz has joined #lisp
ljavorsk has joined #lisp
EvW1 has joined #lisp
<gjvc>
i'm going to get the hardcover version
<jackdaniel>
wasn't it like 5 times more expensive than soft cover?
<gjvc>
yeah, but i strongly prefer hardcover books
<jackdaniel>
I've replaced soft cover in my copy with a hard one for around $5
<jackdaniel>
with a bonus point of having my own cover design
amerlyq has joined #lisp
<jackdaniel>
English word for guys doing it is a "bookbinder" apparently
<LdBeth>
I prefer digital books
<Insanity_>
For books related to programming it depends heavily on the book. "The Go programming language" book had all source code snippets added as images instead of text, which works really well. But I've had books that embedded the code as normal text which does not make for a great reading experience
tko has joined #lisp
<LdBeth>
That sucks. Wouldn’t they even bother to change the font
<beach>
refreshing_drink: #clnoobs has been replaced by #clschool.
<gjvc>
also, beware publishers like "lightning source" -- heard of them?
<Insanity_>
I haven't
<Insanity_>
LdBeth: Changing the font is not really a solution. Because you can select the font you want in digital books. Sometimes they'd italicize it, but the formatting is still fubar. Best to use images
tko has quit [Ping timeout: 276 seconds]
patrixl has left #lisp ["ERC (IRC client for Emacs 26.2)"]
<jdz>
Copy/pasting from images is not very straight-forward.
<jdz>
I mean code from images.
<Insanity_>
Yeah but.. it's also not less straight-forward than with dead-tree books :P
<no-defun-allowed>
I'm surprised typesetting code in a format that just stores strings and positions is hard, honestly.
<LdBeth>
web browser is not typesetting engine, after all
<jdz>
It's not very hard. SVG comes to mind.
<Insanity_>
Perhaps I've just not been lucky with the books I've read :)
<jdz>
PostScript and PDF have been around for a while.
<mfiano>
The worst thing is the typesetting in most programming digital books converts quotes to smart quotes. So many times have I been fooled by quoted s-expressions.
orivej has quit [Ping timeout: 272 seconds]
<LdBeth>
actually most (TeXed) PostScript files only has a low resolution font
<refreshing_drink>
mfiano: are you sure? i didn't see any new lisp for the last few years on his github
<refreshing_drink>
pjb: thanks i will take a look when i get more time to code today
<refreshing_drink>
beach: thanks
<no-defun-allowed>
The biggest pain I've had with typesetting is TeX converts ligature character pairs like "fl" to one character and encodes that weird, so copying "flobicate" gives me "obicate".
<mfiano>
refreshing_drink: I am sure. I talked to him recently. He uses it for personal projects which he does not open source.
<no-defun-allowed>
(Now Firefox does ligatures on proportional characters too, god knows why.)
<LdBeth>
#'no-defun-allowed: that could be a problem of PDF reader you choose
<no-defun-allowed>
Hmm, I think it's happened in Preview.app and evince at the least.
<refreshing_drink>
mfiano: oh nice. he should put more lisp out in the open :p
lalitmee has quit [Read error: Connection reset by peer]
<LdBeth>
Maybe I'm wrong, I don't know how texts are embedded in PDF
<mfiano>
Let Over Lambda is not a very practical book. It's a "look what you can do with Lisp, but really shouldn't" type of book.
<jackdaniel>
so he did not open the pandoric box after all ,)
<LdBeth>
but apprently Preview.app can correctly handle ligatured ffi produced by tex
varjag has quit [Ping timeout: 245 seconds]
<LdBeth>
mfiano: sort like the Dragon Book "Compilers"
<mfiano>
Nah, that's just out-dated. There's a difference.
<refreshing_drink>
mfiano: still it is nice to see a lisper use lisp proudly in public on a git repo :p
<LdBeth>
I think at the days LOL was composed these macrologies are common
<mfiano>
Early on his justification for not using earmuffs around special variables sets the tone for the rest of the book. Like, reader macros to do odd things where a regular macro would have sufficed, or that every function in the book relies heavily on anaphors. Not something you really want to do if others are reading/using your code.
<LdBeth>
it's like arguing "xxx considered harmful"
<mfiano>
The Dragon book is still my goto reference, among two others for compiler theory though. It is pretty valuable to me.
<LdBeth>
If one wants to know how today's industrial strength compilers work, yes.
<refreshing_drink>
does it have things that a lisper would find useful, the dragon book?
<LdBeth>
Yes if you want to write a lisp compiler
<LdBeth>
not a toy one, but also not a very advanced one
<LdBeth>
the other two books fit more onto advenced compiler technologies
<mfiano>
Such as?
<LdBeth>
register allocation algrithoms
<LdBeth>
CPS transformation
<mfiano>
The latest edition has JIT and other newer things.
<mfiano>
Register allocation algorithms would be moreso for an assembler, no?
<LdBeth>
actually it's for program loader/linker
<LdBeth>
link time optimize
<no-defun-allowed>
heisig: Which compiler? So far I have only ever segfaulted the CPython interpreter for no good reason.
papachan has joined #lisp
<heisig>
no-defun-allowed: The Intel C/C++ compiler is a good candidate.
<heisig>
LLVM also has a lot of potential for segfaults once you leave the beaten path.
dddddd has joined #lisp
<no-defun-allowed>
You could probably leak kernel memory using the Intel C compiler if it's anything like their other products.
<drmeister>
heisig: Bike has figured out how to trap segfaults in clasp
<heisig>
I didn't manage to crash GCC, yet. But I once got a very polite apology that it couldn't handle my (standard compliant) code.
<heisig>
But for now I have a very elegant workaround for these problems. I use SBCL as my main compiler :)
<refreshing_drink>
LdBeth: what other 2 books
<dlowe>
good thing sbcl doesn't have any bugs!
<drmeister>
Certain kinds of problems - like dereferencing null I have been able to do again and again without the session becoming unstable.
<drmeister>
Memory corruption though - I wouldn’t like to spend much time in a Common Lisp session with corrupt memory. Brrrr
<jackdaniel>
"you need more them bits." \n ldb>
<LdBeth>
refreshing_drink: whale book; tiger book
lucasb has joined #lisp
<drmeister>
I have managed to crash clang and ld
<refreshing_drink>
LdBeth: what are the whale book and tiger book? are they useful for lisp too?
<heisig>
dlowe: Yes, Lisp compilers have no bugs :D They only have happy little accidents.
<LdBeth>
refreshing_drink: they're not particularly instersting if you're not gonna write compilers
<surrounder>
bob heisig
mindCrime_ has joined #lisp
ldb has joined #lisp
<refreshing_drink>
LdBeth: i'm interested
<ldb>
who's calling me?
<mfiano>
Happy little accidents occur when traversing a little tree?
* ldb
summoned
<ck_>
ldb: which pronunciation do you prefer? ['lidib] or ['liduhb] or ['el'dee'bee]
<mfiano>
eh the whale book is pretty dated and doesn't cover a lot of the modern techniques
<jonatack>
mfiano: sorry to jump in, WDYT of Cooper and Torczon, Engineering a Compiler, 2nd Edition
EvW1 has quit [Ping timeout: 264 seconds]
<ggole>
EaC is a bit unfocused but has a lot of good material
<mfiano>
jonatack: I have it, but I haven't read enough of it to comment
<ldb>
ck_: load byte
<jonatack>
ggole: mfiano: ty
frgo has joined #lisp
<jonatack>
jonatack: mfiano: saaaame
varjag has joined #lisp
ldb has quit [Ping timeout: 244 seconds]
Bike has joined #lisp
thawesWork has joined #lisp
ljavorsk_ has joined #lisp
ljavorsk has quit [Ping timeout: 245 seconds]
caoliver has joined #lisp
cosimone has joined #lisp
<caoliver>
In trying to build SBCL 1.5.6, I'm running into this with docs: The documented contrib sb-aclrepl seems to have failed its tests.
<caoliver>
Any clues?
ldb has joined #lisp
<papachan>
i just tried to install latest sbcl but i have "src/runtime/sbcl not found, aborting installation."
<beach>
caoliver: You might want to ask in #sbcl or on the mailing list.
<papachan>
beach oh thanks
<Xach>
papachan: did you download a binary release of sbcl, or the source?
<papachan>
source
<papachan>
i just take a look at logs: coreparse.c:49:11: fatal error: zlib.h: No such file or directory
shrdlu68 has quit [Ping timeout: 245 seconds]
<ck_>
drmeister: did that LOOP / FOR / WHILE / FOR story have an ending?
ldb has quit [Ping timeout: 248 seconds]
<Xach>
papachan: aha
ldb has joined #lisp
<Xach>
caoliver: for what it's worth, no sb-aclrepl on 1.5.6 sources here. what do your build logs say?
<LdBeth>
papachan: to compile sbcl from source, you need a working common lisp installed
ldb has quit [Client Quit]
<scymtym>
caoliver: did you build sbcl before trying to build the documentation?
tko has joined #lisp
<papachan>
LdBeth ah yeah. i have a previous version running
<caoliver>
Wait a sec. I found a post suggesting an earlier problem in the compile. I'm running my build script which has done the right thing up to 1.4.12 under logsave, and maybe I can find an earlier barf.
<caoliver>
If so, I'll try asking the right thing. Sheesh! ;-P
<caoliver>
I have 1.4.9 bin/core as a build kit. Maybe I need something later.
<caoliver>
/usr/bin/texi2dvi: etex exited with bad status, quitting.
<papachan>
hmm now i have this:
<papachan>
sbcl: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by sbcl)
<caoliver>
Hmmm... Nothing sticks out in the actual build.
alexanderbarbosa has quit [Remote host closed the connection]
rippa has joined #lisp
shifty has joined #lisp
sonologico_ has quit [Remote host closed the connection]
Insanity_ has joined #lisp
<semz>
a cons cell with car being the tag i'd say
scymtym has joined #lisp
<flip214>
jasom: only a single number? or a sum over vectors? or sum, count, and squared sum for statistics?
<jasom>
a sum type, like rust or ML has, where it's a structure that may have different morphologies
<flip214>
perhaps a struct for debugging, and when the bugs are ironed out switch the type definition over to a plain NUMBER...
<jasom>
rust calls them enum's; C would used a tagged union.
<jasom>
I'm considering just using a defstruct of type list; then I could destructure on them easily with something like optima.
thawesWork has quit [Ping timeout: 246 seconds]
<Bike>
i would represent a sum as an (or ...) type, where the members are structs (or less)
<jasom>
Bike: that was my other thought.
<borodust>
question: lets say i wanted to map C structs to CFFI verbatim, is there a way in CFFI to define inner anonymous structs? if there's none, lets say i would define inner structs separately and use (:struct type) in defcstruct for those no-more-anonymous fields. Is there a sane and pleasant way to access these fields of inner structs w/o going for direct referencing of a foreign memory?
<Bike>
since types aren't as strict in lisp, we don't have as much need to refer to the sum as a whole as you do in haskell or whatever
<borodust>
*i want
<jasom>
borodust: I've always just created a lisp name for the anonymous struct.
<borodust>
jasom: that's alright (kinda), but can i access it by having a pointer for the enclosing struct w/o using mem-ref and friends?
<jasom>
borodust: foreign-slot-value or with-foreign-slots
<borodust>
foreign-slot-value would return a pointer to the inner struct?
<borodust>
(inner anonymous struct)
<borodust>
asking for a friend ;p
<jasom>
foreign-slot-pointer to get the pointer to the inner struct
<jasom>
then foreign-slot-value to get a field from it.
<borodust>
i see
<jasom>
oh, actually f-s-v gives you a pointer for aggregate slots anywas
<jasom>
Bike: as a step back; this is a data-description language for tree-like structures, designed for ML and friends. Would you use structures for tree nodes or conses or something else?
<borodust>
jasom: thanks much
<jasom>
borodust: np
<jasom>
Bike: I need to sufficiently preserve the types so as to allow for serialization to a standardized format.
<jasom>
Bike: the base types are just integer, symbol, string, option(any type), sequence(any type).
<jasom>
If I make the sequence be always a vector, I can represent the tree shap unambiguously with conses, but it may still be worth it to have structures.
<Bike>
i don't usually use conses for anything permanent, unless it really is just a binary tree
<jasom>
definitely not a binary tree
<jasom>
I'll do structs then; can use etypecase to switch on the type when walking
gioyik has joined #lisp
vlatkoB has quit [Remote host closed the connection]
<jasom>
aha, I remember now, I was considering using conses because the product types can have unnamed fields. so e.g. to define a cons type, you could do either of: Cons(sexpr, sexpr) or Cons(sexpr car, sexpr cdr)
<jasom>
not a huge deal, I can just have the Nth unnamed field be named field-N
iovec has quit [Quit: Connection closed for inactivity]
gioyik has quit [Ping timeout: 244 seconds]
permagreen has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 245 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
gioyik has joined #lisp
gareppa has quit [Quit: Leaving]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xkapastel has quit [Quit: Connection closed for inactivity]
<jasom>
hmm; if I'm defining a type at runtime, do I use eval?
<Bike>
yeah, that's all you've got.
<Bike>
if you're doing this at runtime i might have to take back what i said about using defstruct, though
EvW1 has joined #lisp
<jasom>
I guess I can hook into asdf to process the file and generate lisp source
tko has quit [Ping timeout: 264 seconds]
varjag has quit [Ping timeout: 246 seconds]
nanoz has quit [Ping timeout: 268 seconds]
zulu-inuoe has quit [Quit: Leaving]
Jesin has quit [Quit: Leaving]
cosimone has quit [Quit: Leaving]
milanj has joined #lisp
cosimone has joined #lisp
akoana has joined #lisp
xkapastel has joined #lisp
Bike has quit [Quit: Bike]
random-nick has quit [Ping timeout: 245 seconds]
<no-defun-allowed>
What library should I use for naive-Bayes filtering?
Jesin has joined #lisp
<no-defun-allowed>
Weird how the PCL Bayes implementation isn't on Quicklisp, like say PAIProlog.
<pjb>
jasom: what's the point of defining a type at runtime?
<no-defun-allowed>
.....or it is, under the name pcl-spam.
Volt_ has quit [Ping timeout: 244 seconds]
<jasom>
pjb: I may compile a file later on that uses it?
<pjb>
Notice that load takes a (or stream …)
Oladon_work has quit [Ping timeout: 260 seconds]
mindCrime_ has quit [Ping timeout: 246 seconds]
hiroaki has quit [Ping timeout: 246 seconds]
ltriant has joined #lisp
<slyrus>
is there anything like with-slots for working with alists?
<White_Flame>
no, but it wouldn't be that difficult to write
Volt_ has joined #lisp
<slyrus>
indeed
<slyrus>
then again it's always easy to make subtle mistakes writing macros and good to use a tried and true one (if one exists).
anewuser has joined #lisp
sjl_ has quit [Ping timeout: 246 seconds]
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
cl-arthur has quit [Read error: No route to host]
cosimone has quit [Max SendQ exceeded]
<aeth>
slyrus: for plists you can use destructuring-bind, treating the plists as keyword arguments, using &key.
<aeth>
for alists, there's nothing afaik
Aruseus has quit [Remote host closed the connection]
Bike has joined #lisp
karlosz has joined #lisp
milanj has quit [Quit: This computer has gone to sleep]
LiamH has quit [Quit: Leaving.]
smazga has quit [Quit: leaving]
<remexre>
I've got a macro with side effects, and it doesn't look like they're preserved across runs unless I touch a file early in the asd file's components list; is there something I forgot to set here?
alexanderbarbosa has joined #lisp
<no-defun-allowed>
I wouldn't recommend using macros with side effects. It would be better to perform the side effects in the code emitted.
buffergn0me has quit [Read error: Connection reset by peer]
iarebatman has quit [Ping timeout: 252 seconds]
buffergn0me has joined #lisp
<remexre>
I fully admit I'm doing something awful :P is there any way to get this to work though?
akanouras has quit [Ping timeout: 252 seconds]
iarebatman has joined #lisp
teej has joined #lisp
akanouras has joined #lisp
Ricchi has quit [Remote host closed the connection]
<Bike>
i'd bind the assoc pairs beforehand so that you don't do assocs repeatedly for the same variables
semz has quit [Remote host closed the connection]
PuercoPop has quit [Ping timeout: 252 seconds]
tko has quit [Ping timeout: 272 seconds]
<jasom>
remexre: macros are expanded at compile-time; ASDF isn't going to recompile or reload a file unless it needs to.
<jasom>
remexre: if you want something to happen every time a system is reloaded, perhaps you could define an :around method for your ASDF system?
PuercoPop has joined #lisp
<jasom>
remexre: oh, I misread; if you want it to happen at load-time, have the macro emit the side effect
<slyrus>
Bike: I'm not sure I follow. before what?
<remexre>
like I'd want to build a function after the definitions
<Bike>
before the body is executed
<jasom>
e.g. instead of (defmacro foo (print "hi")) (defmacro foo `(print "hi"))
<remexre>
so I've basically got (defthing foo (bar baz) ...body...)
<jasom>
remexre: paste what you have?
<remexre>
which is saying "run foo after bar and baz"
<remexre>
which are defined elsewhere
<remexre>
and I've got a (main-loop) macro which emits the actual loop body with the sorted functions
<remexre>
https://p.acm.umn.edu/WzVaAUapAAA= is an older version of the macro (which is a bit more complicated than described above); I'm currently integrating the toposort
<slyrus>
Bike: isn't that what I'm doing? or am I misunderstanding what you mean by "before"?
<Bike>
slyrus: symbol-macrolet doesn't evaluate anything. (symbol-macrolet ((a (b))) (values a a)) is like (values (b) (b))
<remexre>
jasom: is the eval-when the difference?
<jasom>
remexre: look at defapprule which defines a function and puts it in a hash table, then expand-app-rules creates a lamda-expression for doing an optima match
<jasom>
remexre: nope, notice that there are no side-effects in my macro expansion
<remexre>
er, I mean the eval-when in defapprule's expansion
<slyrus>
Bike: yeah, but don't I need it not evaluated so that I can setf my alist?
<remexre>
as opposed to having side effects
<Bike>
slyrus: that's why i said you bind the pairs beforehand - then (setf a b) expands into (setf (cdr pre-evaluated-pair) b)
<jasom>
remexre: the eval-when is needed so that the hash-table is initialized when the expand-app-rules is compiled
<Bike>
slyrus: (also, this won't work if the entry isn't already in the alist, but i assume you know that)
tko has joined #lisp
<remexre>
jasom: er, I guess I mean, is asdf detecting that it needs to run the eval-when effects even when it's not actually doing recompilation? whereas it doesn't detect that for macro side-effects?
<jasom>
remexre: you'll also want to change *main-loop-modules* to defparameter so that you don't end up with a constantly growing list
<jasom>
remexre: this has little to do with asdf; absent ASDF, if you did compile-file and loaded the .fasl you would have the same issue
<remexre>
jasom: that's why I'm not just pushing on a pair in defmodule; I'm allowing/expecting redefinition
<remexre>
and I don't wanna wipe out REPL-defined modules on reload
<remexre>
jasom: s/asdf/the compiler/ then?
<jasom>
the loader, not the compiler, but yes
<remexre>
also is there a reader macro / other idiom for ',foo?
<jasom>
the side-effects of forms are not guaranteed to happen at compile time, so e.g. (setf *foo* 'bar) at the toplevel may not happen during compilation.
orivej has quit [Ping timeout: 248 seconds]
<jasom>
remexre: other than ',foo you mean?
<remexre>
yeah
<jasom>
not sure I understand the question. `(',foo) will evaluate to ('<the value of foo>)
<jasom>
if you are talking about https://github.com/jasom/cl-fccs/blob/master/src/route.lisp#L45 "name" is a variable holding a symbol, so there needs to be quoting in the gethash call; `(gethash ',foo *some-hash*) will expand to a gethash of the quoted value of foo...
<remexre>
Sure, I get what it does
<remexre>
I'm asking if there's a more pleasant way to write it
CrazyEddy has quit [Ping timeout: 245 seconds]
* jasom
was never bothered by it so didn't ever check
<jasom>
you can always use (quote ,foo) if you prefer