freenode/#lisp - IRC Chatlog
Search
17:39:06
warweasle
Xach: I don't think it's used. You can remove it if you like. CL-chipmunk does the same thing faster.
17:40:04
warweasle
Xach: I'm out of open source development for now. I don't know how long that will last. But I've been swamped with other projects. I miss lisp however.
19:07:31
|3b|
warweasle: not sure "use ffi to do 2d physics" is exactly a replacement for "do 2d physics without using ffi" :)
19:11:26
warweasle
|3b|: It is when I have never understood the code. Mostly I just fiddled with things until squirl worked.
19:14:31
|3b|
maybe lispgames could take over if you no longer have time, though not sure anyone else there has all that much extra time either
19:20:11
warweasle
|3b|: The problem is the lisp curse. We all have individual projects but no community accepted game engine. CEPL is about as close as we have. I think bodge has a fairly nice system but I don't know. I've been out of lispgame dev for a few months now.
19:31:30
warweasle
borodust: True...but it takes a few people to build a whole one. I wasn't up to the task. To be blunt, I'm likely not up to the task I'm doing now. But I've obsessed over it.
20:20:52
fiveop
Xach: what is the simplest way to fetch the whole quicklisp dist into <quicklisp>/dist/quicklisp/software ?
20:27:07
fiveop
This will match potential canidates for replacement by alexandria's curry for example '(:list lambda (:list (:register 0 :everything)) (:list :everything (:non-greedy-repetition 0 nil :everything) (:back-reference 0))))
20:27:48
fiveop
wait, that should be '(:list lambda (:list (:register 0 :everything)) (:list (:non-greedy-repetition 2 nil :everything) (:back-reference 0))))
20:37:20
Shinmera
Xach: I wouldn't say xpath is cool, but then again anything associated with xml sucks a lot, so by comparison I guess it's ok.
20:38:02
__rumbler31
Xach: I haven't personally needed it but it lets you say things like "/A/B/C" which returns all child objects of type C from all objects of type B from toplevel object A
20:39:26
__rumbler31
but the concept maps I feel, imagine a query string of (* (* ('foo))) which will give you all foo children of all children of some top level
20:42:20
__rumbler31
i'm not quite sure what you're trying to do, given an sexp with nested sexps you want to apply a matcher and get what back
20:43:39
fiveop
'(:list (:register 0 (:sequence (:register 1 :everything) (:non-greedy-repetition 0 nil (:back-reference 1)))) (:back-reference 0))
20:44:00
fiveop
that matches every list that has an even number (at least 2) of elements that are all #'equal to each other
20:44:54
__rumbler31
where the elements of the lists are equal to each other, or each list is equal to each other list?
20:47:24
fiveop
though you could do that with LENGTH, EQUAL, and EVERY as well, so that might not be that good of an example
20:48:49
fiveop
What prompted me to start was the lack of complexity expressible in macro lambda-lists
20:50:04
fiveop
I would like to write at the beginning of a macro that expects complex structure in its input something like (unless (match *macro-arg-pattern* macro-arg) (error "invalid arg to macro foo"))
20:51:24
fiveop
and since there is (:register <name> <pattern>) match can actually be used to destructure it as well
20:55:30
aeth
pillton: Is it intentional that (declare (optimize (speed 3))) works in specialization-store or is that an unintended side-effect of how you wrote it? It's probably great that the user can control the optimization level because sometimes that's necessary (at least in some implementations)
20:55:46
aeth
However, if optimization declarations are allowed, type declarations are allowed, too!
20:56:09
aeth
(defstore foo (x y)) (defspecialization (foo :name %foo/single-float) ((x single-float) (y single-float)) single-float (declare (optimize (speed 3)) (double-float x)) (+ x y))
20:56:51
aeth
In SBCL, this breaks specialization-store. (foo 2d0 2f0) looks for a specialization that doesn't exist and (foo 1f0 2f0) complains that 1f0 isn't double-float
21:39:09
Shinmera
I suppose I should be happy that I can't tell if that'll actually tell me if there's a failure going on
21:40:51
Shinmera
Anyway, thanks! Hopefully you won't have to manually bother me about failures anymore now.
21:49:27
dim
wow, I think I managed to make quite some progress on my pgloader COPY batch crazyness, now streaming the bytes directly down the protocol when on-error-stop is picked (default in db-2-db cases) rather than the classis on-error-resume-next
21:51:29
dim
https://github.com/dimitri/pgloader/blob/master/src/pg-copy/copy-db-write.lisp --- parts of the inner magic, for perf comments inclined people ;-)
21:58:50
__rumbler31
read through this, your defun descriptions are the same paragraph. Also, was there anything more to your optimizations than including the right (declare... options?
21:59:25
__rumbler31
er that might have sounded belittling. I'm a novice at this, so the most obvious signal is the declare forms
22:01:56
dim
https://imgur.com/zAaK1HM for the turbo thing, if for reasons you don't remember about that...
22:03:28
__rumbler31
I've scrounged together towers with those buttons on them with of course nothing to wire them to. I think I used it once when the wire for the real power button was too short
22:05:46
_death
dim: my advice then is to remove the unsafety declarations and if it's not crawling keep it that way
22:21:06
sjl
1 is the "neutral value" according to the spec. pretty sure most implementations make 1 the default.
22:24:00
_death
dim: safety 0 means you're on the segfault-corruption scale if something isn't right..
22:24:56
dim
well... the patch makes it half as likely for pgloader (using SBCL) to end up in the lldb prompt because if Exhausted its memory space anyway
22:25:59
dim
the typical user of pgloader runs the command and then does something else, segfault won't have more impact than another error condition to them I think, it's not as if I was playing with a live dev env from a lib down
22:27:04
sjl
silently corrupting data they're inserting into the db would probably be more impactful
22:28:54
dim
once again I didn't think it would be that “easy” to implement this idea of streaming without intermediate buffer when on-error-stop is picked
22:31:21
_death
I spent most of my day writing C++.. and a bit of Lisp.. so CL to the rescue here as well :)
22:35:10
dim
for me it feels like I can do in a couple hours in CL what I would have done in a couple days in Python and a week or two in C
22:40:13
z3t0
I have been hacking lisp for a few months and am now starting to write a small program
22:42:18
jasom
Shinmera: the downside to that is that there are such varied styles; it's usually easier to start with a single style when beginning
22:43:57
aeth
There are a few style guides for CL. Here's Google's: https://google.github.io/styleguide/lispguide.xml
22:44:18
aeth
Here's one of many copies of Norvig's: https://www.cs.umd.edu/%7Enau/cmsc421/norvig-lisp-style.pdf
22:44:49
rpg
Speaking of things, does anyone know if Chris Riesbeck's "CS linter" is still out there?
22:45:12
aeth
I don't know anything about the quality of this guide or the author, but I just found this, which is high up on DuckDuckGo's results: http://lisp-lang.org/style-guide/
22:46:23
jasom
z3t0: I can't find a beginners tutorial, but you can get a skeleton setup using quickproject
22:49:19
rpg
Xach: did you get it from the g000001 repo at github? That seems to be the root of the tree on github.
22:51:35
rpg
p_l: package-per-file was integrated into ASDF, but I'm not sure I would say that it's clearly seen as The Right Thing. It is pretty useful if you have complex and changing dependencies (like ASDF and UIOP), because it enables ASDF to figure them out for you. But I can't say I like interacting with systems with that many namespaces, personally.
22:52:15
rpg
Especially since completion sometimes turns nice readable exported names into hard-to-read over-specific sub-packages.
22:53:14
rpg
I would say if you are writing your first system, then you shouldn't need a zillion packages to avoid name collisions.
22:55:23
Shinmera
I consider packages part of the user interface. They don't have much to do with how the code is organised internally, really.
22:56:56
rpg
Shinmera: Occasionally I find myself introducing sub-packages, in cases where there's a clearly delineated sub-function (e.g., some specialized form of tree search), and I want to not have to worry about using common names like "search", "visited," etc.
22:57:54
p_l
Shinmera: If I were to go with package-per-file, I'd probably cleanly separate an "user-facing" package (possibly multiple) that would cover the APIs
22:58:24
rpg
p_l: that's what ASDF does. It has its ASDF/INTERFACE package, that is nicknamed just ASDF.
22:58:36
Shinmera
I guess. I just feel like p-p-f encourages writing huge files, and incurs tedious symbol juggling.
22:59:31
_death
Shinmera: I've already talked about package-inferred-systems advantages/disadvantages in the past though
22:59:46
rpg
Actually, since we're off into the package rabbithole, I should say that though I don't enjoy p-p-f, I *do* think that Fare's macros for defining packages have some really useful features. Especially for p_l's example -- it's nice to have a defpackage variant that will import and then export a symbol with a single specification.
23:01:17
p_l
actually I'd often create a `cl3` package or similar that would use conduits to bridge conduits, closer-mop and bunch of other similar libs into common base language
23:02:22
drewbert
Hi peeps. I'm super new to lisp. I'm looking at the core for a lisp I want to use in a project. I see it has def, which it uses to define defmacro, and defmacro defines defn, and defn seems to be defining runtime functions. What is `def` ?
23:04:06
Shinmera
drewbert: Note the channel topic. This channel is for Common Lisp only. Other lisps have their own channels (#scheme, #clojure, for instance).
23:04:49
Shinmera
drewbert: There's also ##lisp for the family of languages, but I don't know how active it is.
0:11:14
Xach
z3t0_: nth-value relates to getting one of the multiple-values returned from a function via values
0:11:36
Xach
z3t0_: common lisp can return multiple values from a function, like with decode-universal-time
0:18:01
Xach
z3t0_: you normally wouldn't. but it is normal to iterate over a chain of conses (a list) with dolist or loop.
0:18:49
z3t0_
I have a cons of elements that I need to go over in order to process each one, initially i thought of using loop for x in data but that doesn't seem to work
0:18:51
minion
z3t0_: please see 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).
0:19:58
jasom
z3t0_: a cons is just a pair; however they are often used to make a linked list (are you familiar with the linked-list data structure from other languages?)
0:20:24
z3t0_
Yes I am familiar with linked lists, not too sure about how to deal with them in cl htough
0:21:05
pjb
In practice, it's more efficient if the implementation provides primitive implementations of some other types, but it wouldn't be necessary.
0:22:53
jasom
z3t0_: when a CONS is used as a list (car FOO) gets you the data element and (cdr FOO) gets you the next cons in the chain
0:23:24
jasom
z3t0_: and similarly (loop for item in FOO ...) will iterate over the items in FOO, assuming FOO is a list
0:29:08
jasom
hmm, any ideas on how I could get an unhandled memory fault when not using FFI and restricting safety to 3?
0:46:43
Xach
paule32: the error is not adding what you tried, what you expected, and what you got instead of what you expected.
0:52:34
Xach
I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
0:53:39
Xach
paule32: my understanding of a half adder is that it works on bits, as well, and not something like 2 and 3...
0:59:46
jasom
paule32: can you make a simple buffer out of two inverters with this, and show us it working? Because right now this code literally does nothing other than return 'ok
1:01:32
jasom
presumably an and gate would have two wires on its input, and then assert some signal on its output; right now there are no side effects at all.
1:04:40
jasom
paule32: note that there is a function-call there, you've just put some symbols next to each other
1:05:08
jasom
e.g. if you type in: "1 2 3 4" you haven't made a function call, you've just evaluated 4 expressions that do nothing
1:08:21
jasom
right, but this part scheme and common lisp are the same; no parens means no function call
1:08:58
jasom
your wires are also missing actions; without actions you can't define the gate functions yet.
1:15:31
jasom
and is if A & B are logical high, C goes to logical high, otherwise C goes to logical low