freenode/#lisp - IRC Chatlog
Search
4:29:15
dmiles
whould this be adequate semantically? (defmacro pushnew (item place &rest rest) `(unless (member ,item ,place ,@rest) (push ,item ,place)))
4:30:27
dmiles
i am looking at where everyone else passes in an environment.. that is required isnt it?
4:47:23
Bike
"Can't specify the actual keywords [in the macro lambda list] since, apparently, non-constant keywords should be accepted." is an interesting if only tangentially related comment
4:54:17
dmiles
what makes me slightly crazy is that the package that keys go into or come from is so random
4:59:01
dmiles
i kinda liek how specializations happen in SICL .. i might end up using that simular trick
5:12:01
dmiles
i keep meaning to ask.. is there ever a time that "(eval-when (:compile-toplevel :load-toplevel :execute) t)" would not be t?
5:20:32
pjb
if it's a toplevel form then it always return T, but since it's a toplevel form, this T is just "compiled-in".
5:22:34
dmiles
ok so when inside a defun its compiled-in as t (since it contains :execute) i can get rid of eval-when wrapper?
5:23:02
dmiles
more like: ok so when inside a defun its compiled-in as t. Next since it contains :execute, i can get rid of eval-when wrapper?
5:24:02
dmiles
oh i was reading it as ? (eval-when (:compile-toplevel :load-toplevel :execute) (eval-when (:execute) t))
5:26:10
pjb
If you compile-file or load the compiled file then a toplevel (eval-when (:compile-toplevel :load-toplevel :execute) t) returns t (but as I said, it wouldn't matter); If you load the source file, then it would return t too. If it wasn't a toplevel form, then in the first two cases, it would return nil.
5:27:38
dmiles
i'll have to test the: (defun is-it-t () (eval-when (:compile-toplevel :load-toplevel :execute) t))
5:29:14
Bike
(defmacro eval-when ((&rest when) &body body) (if (or (member 'eval when) (member ':execute when)) `(progn ,@body) nil)) for non top level
6:50:38
beach
Is it possible to implement the #= and ## reader macros portably? For standard objects, it is possible to use the MOP to traverse them, but what about structs?
6:54:50
Zhivago
Wouldn't those take effect at the surface of the syntax of the constructing expression, as they are reader macros?
6:55:28
cryptomarauder
when you're far from your loved ones, especially your children, you'll not preocupy about priviledge so much in those moments. Rather christmas becomes something that you wish you could enjoy simply because it's an excuse to step out of the drudgery of apathy and disconnect we generally share most days. To me it's a good thing to practice even if you don't consider yourself a religious person. I for one am not religious.
6:55:29
cryptomarauder
I just say merry christmas becasue I hope you guys don't have to live far from your loved ones like I do. Just this.
6:56:07
beach
Zhivago: Consider #1=#(1 2 #1#). When you build the vector, you have to stick in a temporary object that you then fix up later, once the vector is built.
6:59:53
beach
I guess the same problem happens when you have to deal with instances of custom subclasses of CLASS.
7:04:11
beach
I guess for maximum portability, I could write the fixup routine as a generic function, and have the implementation specialize on their own classes.
7:05:17
Zhivago
If you can change the evaluation semantics to include proxies it should be straight-forward.
7:08:31
Zhivago
crypto: Fair enough. My recommendation would be to just skip the drudgery bit in the first place.
7:10:04
Zhivago
Ah, it has an opt-out clause -- but other than that it looks like it has the same sub-structural issues.
9:51:57
ym
shka, do you see how optimized ring buffers can be implemented on top of existing standard?
9:53:44
ym
I can see how it can work as sbcl extension, but on top of existing vectors, for example, this won't be nor portable, nor optimized.
9:59:34
shka
ym: more importantly: there is NOTHING that prevents you from writing optimized ring buffers in common lisp
10:15:16
ym
I got what bothered me. I want lisp machine reimplemented for FPGA board and able to self-modification. In that way I could build "hardware"-optimized ring buffers.
10:20:19
FareTower
ym: with two FPGA chips, you could have a duo-processor where one updates the other at a time.
10:22:45
ym
Or many such machines could be implemented with 9p support and distribute computing power via network for example.
10:23:00
FareTower
ym: for extra fun, read my essay "who (p)owns your computer" http://fare.tunes.org/computing/reclaim_your_computer.html
10:45:19
Shinmera
For those with a raspberry pi, here's a preview build of Portacle: https://twitter.com/Shinmera/status/945243615021977600
11:46:08
shka
i actually starting to write my own implementation of double ended queue before i reminded myself that there is very decent implementation just lying around
12:29:24
loke
shka: If you need a red-black tree, watch out though. Out of the ones I tried (3 different ones?) none of them were correct.
12:29:49
loke
I ported one myself from a reference implementation, and for the longest time it too had a bug (typo on my part), but now I think it's stable.
12:31:08
TMA
red-black trees are notorious for being easy to get wrong, especially when deletion is involved
12:33:49
loke
TMA: True. I was runnin gbroken implementations for months without really noticing the issue, other than random errors at times that I attributed to a broken red-black implementation. Finally, I added code to record every single addition and removal to the tree and stored it in a log so that I could replay it to prove there was a problem.
12:34:58
loke
I then utterly failed to fix it, because I didn't understand the implementation. So, I deicded to port my own, it worked... Until it didn't. Rinse and repeat and this time I was abel to fix the bug, which was a simple transcription error.
12:35:22
loke
But now it's run for well over a year without a single problem, on a heavily modified tree, so I think it works.
12:35:59
loke
Here's my implementation by the way: https://github.com/lokedhs/containers/blob/master/src/rbtree.lisp
12:36:35
loke
If anyone wants to adapt it into their own library so it can make its way to QL, I'd be pleased.
12:37:39
makomo
when you redefine a function that was previously loaded using Quicklisp in SLIME, how does it know which package it came from (and which definition to update) if you're not in that particular package (i.e. the current package is CL-USER)?
12:38:23
loke
makomo: SBCL tracks where a function was defined, and SLIME (SWANK, actually) uses that information for code navigation.
12:39:01
makomo
loke: hm yeah, but how does it know i don't want to maybe make a new function with the same name but in a different package
12:39:17
TMA
My RB-tree was ok until deletion, after spending a whole day debugging that I have made an AVL tree instead in about an hour
12:44:00
loke
TMA: I'd like mine to become available on QL. It's currently part of my own container library, but I'm considering extracting it out into its own library.
12:55:47
loke
I don't think the world need my container library. The red-black tree is the only newish part of it anyway
12:56:45
loke
shka: If you look at the code from line 302 and below, there is the code that adapts it for my container library. That's the only code you'd need to rewrite:
13:45:07
dmiles
oh crud this " (defmacro incf (place &optional (delta-form 1)) `(setf ,place (+ ,place ,delta-form)))" is broken in "(incf (aref *vector* (incf *special*))) " ?
15:36:31
_death
for incf you can just use define-modify-macro, but in general you want get-setf-expansion
15:39:13
dmiles
(will use it for incf/decf but if it gets complicated they reather write it out all by hand)
15:42:12
dmiles
*nod* i sorta even lumped define-setf-expander into the underutilized category but hadnt get to straight defsetfs
15:44:05
pfdietz
As I recall, ansi-tests has tests that things like INCF don't evaluate things more than once, and also in the right order.