freenode/#lisp - IRC Chatlog
Search
22:31:34
fiddlerwoaroof
Also, when you start doing a bunch of ~* directives, consider ~@* which lets you jump to a specified argument
22:33:02
fiddlerwoaroof
Finally, I wrote a little library that lets you generate format strings in a more readable fashion, at the expense of concision: https://github.com/fiddlerwoaroof/format-string-builder
22:37:48
fiddlerwoaroof
i.e. the numeric argument specifies which argument to jump to, with 0 being the first argument
22:39:31
fiddlerwoaroof
the format invocation should have been: (format t "~1@* ~a ~0@* ~a" :foo :bar)
22:42:10
fiddlerwoaroof
I wonder if beach's sicl could be used for sandboxed lisp execution in minion
22:42:33
fiddlerwoaroof
it'd be cool to be able to ask minion to evaluate a form and print the result
22:47:02
aeth
vms14: Imo, using format for everything, while possible (at least once you mix in "~/package::foo/"), is probably not the best thing as far as readability goes. It's like regexp for everything.
22:47:27
aeth
vms14: Well, at least one format call. Even just breaking things up to 5 or so formats with things like loop mixed in can help with readability
22:48:07
aeth
It works as expected, it's just that you need to always include the package prefix (or else it assumes cl-user, which is weird) and this means you can't use / in package names (which is increasingly common)
22:50:42
fiddlerwoaroof
First you learn to write reader macros and then you learn not to write reader macros :)
22:50:51
aeth
In practice, unless you actually want it configurable with : and @ you basically just do this: (defun foo (stream argument &rest rest) (declare (ignore rest)) ...)
22:51:43
aeth
vms14: I mean, I think we've all been there before with some features of some programming languages, where we learn it, push it to its limits, and then realize that we can't read it the next day, and eventually decide moderation is best, like all things.
22:52:20
aeth
At least to me, it's a lot plainer to use multiple write-foo/prinfoo/format instead of trying to fit everything in one format
22:52:27
fiddlerwoaroof
So, the more you change the syntax with reader macros, the worse your editing experience gets
22:53:30
aeth
vms14: because it's a stream (with a few extras for FORMAT that might not apply to the rest), you can basically mix and match except for (format nil ...) where you're generating a string with the return value (but even there you could concatenate)
22:53:33
fiddlerwoaroof
https://github.com/fiddlerwoaroof/objc-lisp-bridge/blob/master/demo-app.lisp#L93-L99
22:54:20
fiddlerwoaroof
I find these square-brace macros make the ffi part a lot nicer-looking (because it papers over a lot of the ffi noise)
22:54:59
aeth
vms14: Personally, even if I'm 100% using FORMAT, I would keep it to one line, even though one super format string can technically do more, except perhaps for a fairly trivial ~{ ~} usage (but even that I'd mostly use to e.g. turn '(1 2 3) into "1, 2, 3" instead of doing that for lines)
22:55:20
vms14
I'd be happier with M expressions than with S expressions just because {} or [] is faster than write ()
22:57:15
fiddlerwoaroof
It's a really cool idea: when you press shift by itself, it enters a paren, when you push it with another key it inserts a capital
22:58:43
fiddlerwoaroof
This improves every language I write :) and, I use a repl with LINEDIT all the time
22:59:08
fiddlerwoaroof
(and recently, I've been using the Lispworks IDE about 25% of the time I write lisp)
23:02:50
fiddlerwoaroof
Also, Lispwork's application delivery features are extremely well-done and a joy to use
23:10:49
fiddlerwoaroof
I don't know much about NetBSD, but threads work on FreeBSD, so it might be easy to make them work on NetBSD too
3:03:41
matzy_
(note that I gave up on haskell because the installtion process alone on linux was insane)
3:04:26
matzy_
i thought quicklisp was a bit outdated the first few times i used it, but hey, it gets the job done
3:33:36
ahungry
Some would view the lack of version pinning in ql as a problem, but I like that it changes the implicit contract between packagers and users from "Hey, we're going to push BC breaks all the time and just do a major version bump", to something more like "we avoid breaking BC at all costs"
4:03:53
aeth
ahungry: Which would be perfectly fine, but that means that in any higher order function, it should be expected to use keyword arguments with &allow-other-keys so there's no future breakage and there's no real way to enforce that except maybe generating a random nonsense key
4:04:44
aeth
If I'm unclear: if your API expects a function somewhere (even in a macro, not just higher order functions) it should use keywords, and the user should expect to have to use &allow-other-keys so future updates don't break it
4:11:04
aeth
I suppose another alternative is to use one struct/standard-object/list/hash-table/whatever for that
9:19:48
purpur
Hi all. I tried the rosettacode.org example for the primitive version of bubble-sort and it just goes straight to something like an infinite loop for a simple list like "(bubble-sort (list 1 8 7 5 6 0 7 3 4))".
9:21:56
no-defun-allowed
Maybe it's just terribly slow? Random access to lists is slow, and bubble sort runs in O(n^2) time.
9:22:17
ck_
purpur: try handing in a symbol instead. (defparameter my-list (list 1 8 7 5 6 0 7 3 4)) (bubble-sort my-list)
9:23:06
decent-username
Is there a way to redefine a structure without starting a new REPL? I've always simple avoided the problem that way.
9:24:59
phadthai
you'll need to recompile anything that depends on that structure, as unlike for clos, accesses may be very optimized as memory offsets
9:25:32
purpur
no-defun-allowed: I waited like 1:30 min and it just keeps going. It canĀ“t be that slow for a list with less than 10 elements
9:27:17
Shinmera
The long answer is you need to remove all symbols the structure definition touches, and then recompile everything that used any of those definitions.
9:27:41
decent-username
Shinmera: thanks for the answer. So I'll have to simply start a new REPL. :^D
9:28:40
no-defun-allowed
purpur: Oh, the code is broken with duplicate elements. Try with a comparison function #'<= and it will work.
9:30:09
no-defun-allowed
https://plaster.tymoon.eu/view/1511 Here is my somewhat improved version, which will play nicer with lists.
9:35:05
purpur
no-defun-allowed: Thank you for the detailed explanation. Iam just starting with lisp and searched for a simple variant of bubble-sort. I will have a look into your code snippet.
9:36:54
lorenzoi
hello I am having issues with loading quicklisp in sbcl. I have the load script in my sbclrc but it does not load.
9:41:36
decent-username
lorenzoi: A bit more information would be nice. How did you end up in this situation?
9:42:13
lorenzoi
I wanted to load up a package in an sbcl repl in my browser, but it said that the package QL did not exist
9:43:32
decent-username
lorenzoi: You need to start sbcl with quicklisp. For this you would need to execute "sbcl --load quicklisp.lisp". After doing that you'll need to evaluate "(ql:add-to-init-file)"
9:44:20
decent-username
if you encounter any error before that, try to delete you ~/quicklisp directory and follow the procedure that's described at https://www.quicklisp.org/beta/.