freenode/#lisp - IRC Chatlog
Search
9:21:54
dim
I've heard about the BBC initiative for exposing kids to programming, the Micro-Bit, a kind of very cheap arduino board with many popular extensions; and to program it in Lisp all I can find at the moment is http://www.ulisp.com/show?2672
9:22:20
dim
do you guys know if there's an implementation of Common Lisp that would target this little board?
9:29:26
no-defun-allowed
also, it has one of those separated code and data models that make COMPILE pretty useless
10:07:46
vaartis
wanted to ask if there's a way to bundle static files when building the program with something like program-op?
10:08:54
vaartis
and is it a decent idea to bundle a dynamic library with an asdf system that someone might install from quicklisp, and if so, how do i do it
10:18:55
vaartis
I see.. I want to write bindings for a certain library that isn't in linux package managers, but takes less than a minute to build and doesn't have any dependencies, so i though about maybe just building it for most platforms and bundling like this python thing does http://www.pymunk.org/en/latest/index.html
10:19:28
loke`
vaartis: You can ship the source code as part of the package and then build it if needed.
10:20:06
loke`
THat's something I believe IOLIB should do with libfixposix, but the author don't agree
10:22:15
loke`
vaartis: Windows is an oddball. Personally I don't really pay much attention to that one.
10:23:25
vaartis
The problem is, asdf doesn't copy static fles to the destination directory when using e.g. program op
10:36:50
vaartis
https://common-lisp.net/project/asdf/asdf/Predefined-operations-of-ASDF.html#Predefined-operations-of-ASDF
13:07:30
jcowan
Question: when if ever does it make practical sense to mix &optional, &rest, and &key in a single lambda list, other than the special case of &allow-other-keys?
13:09:48
Bike
&rest and &key together is useful if you want to throw your arguments at some other function
13:14:05
jcowan
Right. I didn't think of the pass-along case, only of the crack-keys-yourself case (like structure constructors)
13:16:05
jcowan
I'm glad to hear that &optional and &key together doesn't make sense. I am evaluating a pair of macros for Scheme, which has only &rest (spelled "."), one for optional arguments and the other for keyword arguments. I was checking that it made sense to separate them.\
13:16:37
Bike
i mean the rules are consistent and everything, and the code will compile and run... it's just confusing
13:17:17
jcowan
I feel no great need to push for the standardization of functionality that serves only to confuse people. :-)
13:19:13
jcowan
in my context that would mean using the macro (which accepts a rest-list and binds variables corresponding to the keywords) as well as the raw rest-list itself.
13:19:54
pfdietz
I wonder if SBCL tries to check if a &rest arg's list is being mutated (the list itself, not the objects in the list)
13:22:00
pfdietz
It's permitted (but not required) for a CL implementation to reuse the last argument to APPLY as part of the rest list, so destructive modification of that list is a no-no.
14:05:02
pfdietz
Better to have some sort of "rest args object" from which a list could be obtained, if needed. APPLY would take one of these (or a list) as a final argument.
14:14:17
pfdietz
WHich means that list is being copied. Gets expensive with very long lists. This shows up in a programming style where one adds new :key arguments to this list down a call chain.
14:17:03
jcowan
Standard Scheme has no keys at all. The macro I'm looking at will not reject multiple uses but ignores all but the first.
14:18:30
jcowan
The signature of the macro is (let-keywords ls ((var [keyword] default) ... [rest]) body ...) where ... is postfix for iteration. Note that the variable can have a different name from the keyword, though you probably won't want that much.
14:25:36
jcowan
As I was saying, you put a newly consed object into a non-exported global variable and set that as the default: no one can pass you that object, so an eql test shows whether the keyword is missing or not.
14:28:04
jcowan
I have used the same trick for alists as poor man's objects: if the first element in the alist is (<unique> . foo), code that cares can treat it as of type foo, and to code that doesn't it's just an alist.
14:30:58
flip214
If I hang around here for some more time, I might be one of the elders... probably still not considered wise, though.
14:37:20
pfdietz
Talking about scheme to shed light on CL issues is borderline acceptable for #lisp :)
14:46:49
dim
I'm trying to find this blog post of years ago with an implementation of FizzBuzz all as a single format string in CL, does it rings a bell to anyone here?
14:48:01
pfdietz
https://www.reddit.com/r/lisp/comments/59ikqm/the_most_elegant_implementation_of_fizzbuzz/
14:52:09
dim
well there's one that might be close to what I had in mind, let's call it good enough ;-)
16:54:28
shka_
vms14: abstraction layer, this way you can TRACE access to the html-mode, you can define logging, you can do all sorts of stuff
16:57:06
Bike
that's how setf works. if it can't find an expander or anything, (setf (foo ...) bar) becomes (funcall #'(setf foo) bar ...)
16:59:26
Jachy
Maybe the answer vms14 is more simply, convention? You'll often see a get/set pair of (get-foo) and (setf (get-foo)) instead of (get-foo) and (set-foo).