<Shinmera>
Which I'm happy to say names Parachute as the overall "best".
<Shinmera>
That's in quotes because it depends on what you need.
aartaka has joined #commonlisp
<frodef>
That survey was quite an extensive answer :) Thanks!
<nij->
Yeah. Thanks for sharing!
<frodef>
I've tried to look at fiveam, but I find the documentation overly terse.
cosimone has joined #commonlisp
Algernon69 has joined #commonlisp
Algernon91 has joined #commonlisp
akoana has quit [Quit: leaving]
aartaka has quit [Ping timeout: 252 seconds]
aartaka has joined #commonlisp
Algernon69 has quit [Ping timeout: 240 seconds]
s-liao has quit [Ping timeout: 256 seconds]
<jackdaniel>
Shinmera: autoquoting functions in IS is quite annoying, I can't say i.e (rcurry #'member …) because it recognizes only symbols and lambda expressions
<Shinmera>
you mean for the comparator?
<jackdaniel>
yes
<Shinmera>
Yeah I'm not too happy with the magic of that either
<frodef>
So about testing, is the "best practice" to put tests in separate source file(s) from the code, or intertwine it with the target code, or what?
<Shinmera>
separate files. you don't want to pull in a test framework as a dependency for your regular library.
<jackdaniel>
well, you can always put them behind a feature flag
<Shinmera>
that's not going to fly well with asdf.
<jackdaniel>
i.e #+fiveam (Deftest …) but yeah, they are usually in separate files
<utis>
i had a feeling i'd seen a way to have a long argument name that shows up in slime hints and a short one in the function, but couldn't find it. i suppose there's no such feature?
amb007 has joined #commonlisp
<phoe>
long argument name, what do you mean?
<phoe>
as in, you have a symbol with a really long name interned into some package and you want to locate it?
<utis>
like (defun foo (string) . . . but with `s' in the body
<phoe>
oh, like that
cage has joined #commonlisp
<phoe>
hm, I guess you could (defun foo (string) (symbol-macrolet ((s string)) ...))
<Shinmera>
why bother, just (let ((s string)) ...)
<phoe>
or that, sure
<utis>
yeah, just wanted to make sure there wasn't a neat builtin way of doing it
Jing has quit [Ping timeout: 240 seconds]
<Shinmera>
another solution is to just write an emacs macro to type out the long name for you ;)
<utis>
it's more that i like having hints that are simlar to those in other functions, but i don't like the sight of long names repeated
attila_lendvai has quit [Ping timeout: 240 seconds]
Jing has joined #commonlisp
<utis>
how about defgeneric with long names and defmethod with short names? is it a bad idea to use methods when functions suffice?
<Shinmera>
Yes
<Shinmera>
Anyway, I'm writing a roundup for all that happened in 2021 with Kandria. What's everyone else up to on the last day of the year?
mingus has quit [Ping timeout: 250 seconds]
<phoe>
well I'm having fun with lisp after a long sabbatical from programming in it
<phoe>
doing some vector graphics in it with Xach's vecto in order to make a tile generator for one board game
<phoe>
plus the recent vecto PR that adds radial gradients
<Shinmera>
Reminds me I still need to add support for gradients into Alloy's GL backend.
<Shinmera>
(which reminds me of a huge number of other things that still need to be done, SIGH)
<phoe>
and all of that is generated from 300 lines/10kB of my own Lisp code plus vecto
<kakuhen>
phoe: you reminded me i made fast progress on some toy mahjong utility, only to suddenly stop because I couldn't think of a good algorithm to count sequences for shanten calculations
<phoe>
kakuhen: gasp
<kakuhen>
it was also the first program i got to use reader macros in, since my notation for tiles uses lists internally
<phoe>
maybe we can join forces eventually, I also need to do shanten calculation in my mahjong stuff
<kakuhen>
but i allow the usual to input hands with the "usual" notation
<kakuhen>
and an ugly reader macro converts user input to a list in a format my program accepts for processing tiles
<kakuhen>
it may not be a good representation but i stuck with it over, say, a CLOS object, for simplicity
<phoe>
doing a reader macro is trivial at that point
<kakuhen>
yeah; also, the list representation is nice because then counting frequencies of tiles in a hand is really elegant, at least to me
<phoe>
sure
<kakuhen>
i populate a hashtable with tiles not associated yet, then maphash to get what i want
<kakuhen>
its hard to explain in english; id have to share the code
s-liao has quit [Ping timeout: 256 seconds]
<kakuhen>
but its really simple and generalizes to counting n repetitions of tiles in a hand
<kakuhen>
then i had to count sequences and got lazy because I dont know how I should interpret, say, 4556
<kakuhen>
Should the algorithm consider it one sequence and an isolated tile? or two partially complete sequences? Which one you choose will alter the end result
<kakuhen>
anyway this is barely CL related so I'll end here
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
treflip has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
Alfr is now known as Guest1333
Guest1333 has quit [Killed (strontium.libera.chat (Nickname regained by services))]
Alfr has joined #commonlisp
<sm2n>
I'm not sure who to tell this to, but cliki appears to be down
<rotateq>
yes could happen some time due to how it's hosted
<rotateq>
but i don't have a clue where and how it is
* phoe
takes it to #common-lisp.net
<rotateq>
oh there's such channel .. *curious*
lisp123 has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
mingus has joined #commonlisp
mingus has quit [Client Quit]
s-liao has joined #commonlisp
aartaka has quit [Ping timeout: 260 seconds]
aartaka has joined #commonlisp
tyson2 has joined #commonlisp
Inline has quit [Quit: Leaving]
miique has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
pranavats has joined #commonlisp
_73 has joined #commonlisp
random-nick has joined #commonlisp
Inline has joined #commonlisp
Inline has quit [Client Quit]
Inline has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
<etimmons>
On this last day of the year, I'm learning more than I ever wanted to know about win32 APIs
<etimmons>
(working on cl-tar extraction/creation on Windows and want to handle symlinks)
<tyson2>
my former boss, one of the designers of Logo, Scratch, etc., really misses the win 32 api. Now he implements stuff in javascript :(
<rotateq>
"And if you want to trick your boss that you can do stuff in LISP, tell him it's similar to XML." :D
s-liao has joined #commonlisp
<ns12>
Hello, when using MAPHASH, it is possible to abort the iteration without going through the rest of the keys of the hash table? For example, if I have found the key-value combination that I am looking for, I no longer want to look at the rest of the entries in the hash table.
<_death>
(block foo ... (return-from foo) ...)
<frodef>
ns12: Yes, with RETURN, or GO, or whatever.
<rotateq>
or you do it via LOOP
<ns12>
Okay, I could probably do (block foo (maphash (lambda (k v) ... (return-from foo)) the-hash-table))
<Shinmera>
etimmons: At least it's documented.
<_death>
you can also check out with-hash-table-iterator
<ns12>
Is it possible to iterate through a hash table using a DO loop?
<_death>
w-h-t-i gives you a function to call, so you can call it in the DO form
<_death>
the issue there is that it uses multiple values, which makes you jump through hoops if you don't call it in the DO body.. so there are more straightforward solutions
<Shinmera>
Why *do* you want to do it with DO or maphash anyway
<Shinmera>
LOOP is almost always more concise and clear for this purpose.
<ns12>
Shinmera: Currently learning about the different methods of iterating over hash tables.
<etimmons>
Shinmera: true! I'm actually mostly happy with the experience so far. I'm just a bit salty that the only real way to get the target of a symlink is an ioctl followed by some parsing of a data structure that contains a maybe not null terminated wide string.
<etimmons>
At least doing this in CL means I can iterate fast when trying to figure out how it all works :)
lisp123 has quit [Remote host closed the connection]
Algernon91 has quit [Ping timeout: 245 seconds]
<Shinmera>
Yeah, at least until your image gets corrupted
<_73>
I am having trouble figuring out the syntax for passing a condition argument to the SIGNALS macro from the fiveam system. I can't find an example of its usage. I am specifically confused about the error message `unknown type specifier: QUOTE`? http://dpaste.com/GHYNZGJLJ
Algernon91 has joined #commonlisp
<beach>
_73: Since it is a macro, maybe the type specifier is not evaluated.
<beach>
_73: If so, remove the quote in front of FOO-ERROR after SIGNALS.
<beach>
The SIGNALS macro has a bad docstring.
<_73>
one moment I am still getting an error
<beach>
But I am guessing that it is saying exactly that, i.e., that the CONDITION-SPEC argument is not evaluated.
<beach>
_73: [unrelated] Also, I suspect that the THROWS in the name is inappropriate
<_73>
ok I just don't understand condition systems well enough yet
<beach>
_73: THROW is not part of the condition system. Errors are not "thrown" in Common Lisp. They are "signaled".
<phoe>
in general, conditions are signaled, not thrown - that's the CL nomenclature, "throw" is a control flow concept whereas "signal" is a condition concept
<beach>
In general, conditions are "signaled".
<rotateq>
beach: Do you sometimes use the special operators CATCH and THROW directly or more in macros? (like with maybe TAGBODY)
<beach>
I don't think I have used it in a macro, but I use it for that kind of non-local transfer of control.
<rotateq>
phoe: You're always welcome too of course!
<phoe>
they're a natural fit for backtracking
<phoe>
:D
<rotateq>
Maybe when I finally read and understood more of your book I finally can do something more with the condition system.
<phoe>
to be honest, nowadays I think TCLCS is less about the condition system and more about using control flow techniques and macro writing
<phoe>
at least the first two big parts are
<frodef>
Is there any other language (than CL) that doesn't conflate SIGNAL and THROW?
<beach>
Maybe Multics PL/I since it was the inspiration for the Common Lisp condition system.
<rotateq>
frodef: Erlang is also very interactive as a system runs, but I don't know what terms they use.
<frodef>
Shinmera: parachute looks good! When I have a bit of combinatorial explosion in generated tests, is there a way to group them so as to avoid hundreds of checkmarks in the default report?
_paul0 has quit [Remote host closed the connection]
<Shinmera>
There's no facility in the plain report to hide groups, but there is a grouping macro to make more fine-grained groups than on the test definition level.
<Shinmera>
err, hide group contents.
<frodef>
Shinmera: what macro is that? Searching for "group" fails me..
<Shinmera>
frodef: (apropos "group" "PARACHUTE") ; => group fbound
<Shinmera>
Ah, yeah. Docs are not autogenerated, so might be out of date.
<frodef>
hm.. isn't the point of autogenerated docs that they *don't* go out of date? :)
<Shinmera>
you might be missing a *not* here.
_73 has quit [Remote host closed the connection]
<frodef>
hm.. how so?
<phoe>
the parachute docs are *NOT* autogenerated
<frodef>
ah, sorry, I misunderstood! :)
<frodef>
s/misunderstood/failed at reading
<MichaelRaskin>
phoe: hmm now I read your tests and fail to understand if (amb:amb ((x (list 1 2))) (amb:constrain (> x 1)) x) should work
aartaka has quit [Ping timeout: 240 seconds]
<phoe>
MichaelRaskin: it should work, if I understand it correctly
<frodef>
rotateq: From a glance, Erlang seems to conflate SIGNAL and THROW completely.
<phoe>
X is allowed to take values from (1 2)
<phoe>
then there is a constraint that X must be greater than 1
<phoe>
1 does not match that constraint, but 2 does, so then X is returned
<sm2n>
frodef: what it essentially comes down to is having both nonlocal exits and having access to both dynamic and lexical scope, I think
<sm2n>
and no other language is coming to mind, but I'm sure there's some niche scheme that implements both (throw/signal)
<MichaelRaskin>
Oh how interesting, if I load amb.lisp directly (lazy me) it half-works, but via ASDF it works properly, and I don't see why is the difference
jstoddard has joined #commonlisp
<frodef>
sm2n: I also rather suspect that THROW/SIGNAL is the prize (among several) you get when you haven't made a lot of horrible assumptions early on in your language/runtime design :-)
<sm2n>
sure
attila_lendvai has joined #commonlisp
raeda has quit [Remote host closed the connection]
raeda has joined #commonlisp
<phoe>
half-works? what do you mean?
<MichaelRaskin>
Without constraints it works, but with constraints it does not
tyson2 has joined #commonlisp
<MichaelRaskin>
I am just impressed that it is not obvious what is the source of the problem when loading things wrong
gaqwas has joined #commonlisp
gaqwas has quit [Remote host closed the connection]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
amb007 has quit [Ping timeout: 245 seconds]
amb007 has joined #commonlisp
<sm2n>
Shinmera: is there a reason that parachute uses a fullwidth question mark in the default report?
<sm2n>
it's bothered me for a while because it usually means it goes to a fallback font and that screws up the spacing
<Shinmera>
because the other ones also use a unicode symbol that is typically full-width, so that it's aligned.
szkl has quit [Quit: Connection closed for inactivity]
<Shinmera>
there's no pleasing everyone though, depending on the font it's gonna be wrong one way or the other.
<Nilby>
I appreciate the lovely big check marks.
amb007 has quit [Ping timeout: 260 seconds]
amb007 has joined #commonlisp
<sm2n>
fair enough I guess
jealousmonk has joined #commonlisp
Jing has quit [Remote host closed the connection]
Devon has quit [Ping timeout: 240 seconds]
mrmr5 has joined #commonlisp
Jing has joined #commonlisp
mrmr has quit [Ping timeout: 256 seconds]
mrmr5 is now known as mrmr
<Josh_2>
Is cliki dead?
<hobo>
shouldn't be
<phoe>
MichaelRaskin: weird!
<Josh_2>
hmm
<Josh_2>
Got a 503
<phoe>
Josh_2: yes, there is an issue
<Josh_2>
rip, I should have saved the bknr manual
<Josh_2>
ha, nice I have it open in another tab
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
rain3 has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Ping timeout: 240 seconds]
<hobo>
Shinmera: i thought the only "correct" font was Comic Sans M?
<phoe>
so split-sequence only splits with delimiters of length 1, so, single sequence elements
<phoe>
whereas the regex split utilizes regex
<yottabyte>
Gotcha
Jing has quit [Ping timeout: 268 seconds]
Jing has joined #commonlisp
pk has joined #commonlisp
Oladon has joined #commonlisp
<aeth>
imo, always use the simplest function for the task
<phoe>
^
<aeth>
combination of probably faster + more people can understand it
jasom has joined #commonlisp
karlosz has quit [Quit: karlosz]
VincentVega has joined #commonlisp
NotThatRPG has quit [Remote host closed the connection]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
NotThatRPG has joined #commonlisp
NotThatRPG has quit [Read error: Connection reset by peer]
epolanski has quit [Quit: Connection closed for inactivity]
akoana has joined #commonlisp
myrrh has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
VincentVega has left #commonlisp [ERC (IRC client for Emacs 27.2)]
notzmv has quit [Ping timeout: 260 seconds]
<alcaeus>
Question: how do you loop some code over one second? Something that looks like this but that works. https://pastebin.com/9n1ymdkD
<pjb>
alcaeus: dont' use equal but <
<pjb>
or >
<pjb>
alcaeus: also, get-internal-real-time gives you time in some internal unit. So 1000000 internal units can be whatever.
<pjb>
alcaeus: multiply with internal-time-units-per-second
<pjb>
(or divide).
<alcaeus>
pjb: figured equal might be an issue, but with < it still returns nil (internal-time-units-per-second = 1000000 on sbcl)
<pjb>
No, even on sbcl, internal-time-units-per-second can be anything.
<pjb>
It depends.
attila_lendvai has joined #commonlisp
<pjb>
There's a #sbcl channel too.
<alcaeus>
thanks but the code is still not returning internal-time-units-per-second, which is the goal... is it a misplaced return statement? my loop fu is not great either :P