freenode/#lisp - IRC Chatlog
Search
13:37:09
lukego
check-it code looks really nice to me at first glance. heavy on a pattern matching library called OPTIMA that looks nifty too
13:37:26
lukego
seems like the generators can be used independently of the testing framework (but I'll probably want that later)
13:47:05
lukego
hm but being part of an automated test framework there maybe aren't the right knobs for generators. Seems like the random sampling takes a uniform value up to a size limit, whereas I'd probably like some other random distributions e.g. log transform to bias towards small values while still permitting bigger ones. maybe can put that into the framework. reads...
13:51:06
lukego
check-it source is really easy to read with the patterns, for me at least who's worked in patterny languages sometimes in the past (otherwise surely cognitive overhead)
13:52:24
lukego
guess it's also one of those things where if you're doing pattern matching you'll tend to choose basic data structures to suit
14:57:16
lukego
I feel dirty when I call SB-INT:COLLECT. Is there an obvious way to launder that e.g. via alexandria or something?
15:01:36
Gnuxie[m]
Josh_2: Postmodern/Mito/json-mop have readable examples for slot classes and other basic use cases (but honestly h*ck ORM)
15:02:27
jackdaniel
lukego: collect originates from cmucl, here is one of many utility copies: https://github.com/McCLIM/McCLIM/blob/master/Core/clim-basic/utils.lisp#L716
15:03:07
lukego
I'm actually fine with being non-portable it just feels icky to reference SB-INT in source code because it looks "internaley." Back when I used CMUCL I was more than happy to use EXT:COLLECT :)
15:03:41
lukego
Or otherwise how would you convert alexandria's MAP-COMBINATIONS into a COMBINATIONS function that accumulates into a list?
15:04:03
Josh_2
Gnuxie[m]: I'm not sure, I need to get a gist of what I can do with it before I can understand how I can apply it to current projects
15:05:14
lukego
jackdaniel: yeah fair enough. I did the next best/worst thing of updating my defpackage with (import-from #:sb-int #:collect)
15:06:31
lukego
I'm curious though how other people usually do "collecting" with "mapping" functions though? I mean for data that's not supported by loop accumulating keywords and doesn't provide a reduce-like accumulating version
15:13:05
phoe
"with great expressiveness comes great possibilty of making Lisp as readable as poorly golfed Perl"
15:17:22
lukego
shoe changing foot quickly :-) thought I was clever doing (collect ((comb)) (alexandria:map-combations #'comb list)) ...) but of course COMB is a not a function...
15:18:16
lukego
not immediately obvious to me that COLLECT needs to use MACROLET instead of LABELS under the hood either...
15:19:36
phoe
at least my lambda example up there has a single anonymous function for collecting stuff
15:19:47
contrapunctus
beach: I had a look at the 'ancient CL version' of OpenMusic on GitHub...it seems to be GPL, whereas I prefer to Unlicense my work. 😔 I guess I'll look into wrapping the RtMIDI C API, which seems like the next most pragmatic route.
15:21:10
jackdaniel
the macro collect uses macrolet to allow having any collecting method, not only collect list
15:23:56
lukego
collectors library looks nice but code doesn't seem to match implementation. (collecting (map-combinations #'collect list)) should do what I want but the macro doesn't parse those args
15:34:14
lukego
so my ultimate compromise for now is to take the nice COLLECTING interface from the COLLECTORS documentation, which isn't really supported by that library as installed from quicklisp, and port it onto the top of SB-INT:COLLECT. good enough for now. https://gist.github.com/lukego/1714405ba893250812bf522a1e4f1b97
15:39:34
lukego
then you can (defun permutations (list) (collecting (map-permutations #'collect list))) which is a darling I haven't murdered yet :)
15:51:04
lukego
So next naive question perhaps leading to a hot library tip: how would you compute the list of all subsets of the set LIST?
15:54:56
lukego
I find myself writing a recursive function but it feels like this should exist and that makes me wonder if I'm missing another alexandria/uiop sort of library
15:58:55
phoe
(let ((x '()) (list '(1 2 3 4 5))) (loop for i from 0 below (length list) do (alexandria:map-combinations (lambda (y) (push y x)) list :length i)) x)
16:01:11
lukego
phoe: oh nice. I can combine that with my little NIH macro and have (collecting (dotimes (i (length list)) (map-combinations #'collect list :length i))) which is just fine
16:03:33
lukego
I like this little collecting/collect pair from COLLECTORS interface because I'm not sure that I've ever actually had multiple collectors with COLLECT nor given a collector a useful name
16:11:17
dlowe
Seems like you could make a list type if you could do (deftype my-list (or (cons my-type my-list) null))
16:16:21
Bike
recursive types introduce complications into the system that i, at least, wouldn't know how to solve. for example under the usual recursive definition of subtype, #1=(cons t #1#), which i would understand as the type of infinite circular lists, is a subtype of the bottom type NIL
16:46:57
frgo
Hi all: question: I need to copy a large (2GB) in 255 byte chunks into foreign memory using CFFI. Would I use something like https://github.com/jetmonk/waaf-cffi for this?
18:04:51
frgo
phoe: Hmpf - yup. You are right - it's the simple things that sometimes are hard to find ... Thanks!
18:50:17
aeth
you can search "written by" and keep expanding the time interval until the person you are looking for has spoken, but keep in mind that it's rate limited to a very noticable length, maybe 5-10 seconds... https://irclog.tymoon.eu/search?channel=freenode%2F%23lisp
18:50:49
aeth
There's no all-channel search, though, so a bot has the advantage that it might have seen someone on another channel who hasn't spoken here recently.
21:16:29
younder
Truth be told I write drone software these days. Hardly any Lisp. I just hang around for old times sake.
21:22:09
Josh_2
i'm looking back at some of the code I wrote over a year and trying to fix it up, It's dreadful oof
21:22:42
younder
The easiest way is use a shell language interface like the one provided by imagemagic. Shell out to that and it should provide what you need.
21:27:44
torbo
What's the best way to parse a string representation of a rational number (i.e. "3/4") into a rational number in CL?
21:29:02
Bike
easiest is READ but it'll do bad things on malformed input. you could use POSITION to get the solidus, and then PARSE-INTEGER both sides.
21:46:12
younder
Bike is a PhD. He writes robust code for industrial applications. I am guessing turbo isn't there yet.
21:56:02
aeth
here? I remember pjb being banned from #scheme for a short while for only being there to promote CL... that might be what you're thinking of.
21:58:38
Bike
as jackdaniel said, already, less than an hour ago, he was banned from here for a few days
21:58:38
scymtym
i think people are referring to this: https://irclog.tymoon.eu/freenode/%23lisp?around=1592014365#1592014365
22:04:36
younder
I don't know by I have not been here. Left andforgotten and mostly irrelevant. If I say someting that sounds like misinformation, please let me know.
22:20:56
Josh_2
This community is pretty small, last thing needed is isolating individuals over petty stuff like being abrasive
22:22:30
White_Flame
there's a difference between being abrasive and being intentionally obtuse, screaming that everybody's correct and applicable answers are absolutely wrong in expletive laden screeds
22:24:05
Josh_2
I started here when I was basically 100% new to programming and I got that impression from him pretty early, I still appreciate the walls of text to this day
23:23:08
stylewarning
dlowe: CL:BULLSHIT isn’t a part of ANSI Common Lisp. *DEFAULT-BULLSHIT-DEFAULTS* may have bullshit or other components of bullshit, though.
23:23:23
aeth
pjb gives particularly bad advice on IRC when the question is about the type system ime... His advice is consistently to never check types and just let things fail at the point where they fail, but ime that just leads to a random NIL showing up 20 functions away from where it was generated and a waste of a day.
23:30:29
aeth
ABCL is Java-based and not very popular, at least on IRC, so you would probably have better odds with ECL, which is designed to be embedded in C applications.
23:37:46
aeth
johntalent: It looks like all other (not GDScript, VisualScript, or C#) languages are supposed to interface through the GDNative C++ bindings. https://docs.godotengine.org/en/stable/getting_started/step_by_step/scripting.html#gdnative-c
23:38:08
aeth
ECL or even Clasp (the latter is a work-in-progress) seems like it would be a lot less painful than trying to bring in the entirety of the Java environment
23:55:56
borodust
aeth johntalent: i guess i need to add a warning there or smth - those bindings are highly experimental - i never used them it was just an experiment to see how hard it would be to generate bindings for godot
0:03:57
borodust
once i'm done with c++ support in :claw i might get back and actually try them out :)
0:04:53
borodust
hopefully, that doesn't mean never, cuz i'm 95% done implementing it and only need to finish the other 95%