freenode/#lisp - IRC Chatlog
Search
14:41:40
_death
20 years ago people played jokes on irc newbies telling them to join #2,000 or somesuch, and upon trying, their irc client (mIRC) would part the current channel
17:21:02
takitus
defer is one of Go's weirder ideas. The authors present it as a better solution to the 'goto cleanup' trick common in C functions, but building a stack of statements to execute when a function returns (somewhere) seems very abuseable.
17:33:34
dlowe
takitus: the advantage it has over "goto cleanup" is that defers can be conditionally added
17:34:44
dim
ah yes I like your with-defer macro, in so much as it shows why I'm tired of languages with a syntax...
17:37:13
dlowe
The advantage of lisp is you get to have any syntax you want, without having to wait for some faraway language implementor to add it.
17:40:35
dim
dlowe: I meant the other way round, if you want with-defer in Go you have to wait until the language designers make it happen, or in Java, or etc... whereas you could just make it happen
17:48:22
dlowe
speaking of macros, Fare's latest blog entry is pretty neat: https://fare.livejournal.com/189741.html
17:51:27
dim
I've been using bind in places and I like it better: I like indentation and as he suggests I think needing more of it is a mistake in the code
17:56:35
_death
yes, nest is a crutch like chain (or "->" as some like to call it) is a crutch.. the latter may make sense in rare cases
18:08:03
takitus
dim: That was my thought on reading that as well. To paraphrase Linus Torvalds, if you need that much indentation you're screwed anyway.
18:31:16
didi
Eer, I bet everyone knows this, but did you know you can use NIL to discard bindings on `destructuring-bind'? Cool.
18:45:45
dim
How can I have the equivalent of (ccl:make-external-format :character-encoding :ascii :line-termination :crlf) in SBCL?
18:45:50
didi
Oh well, better have our hopes and dreams shattered sooner rather than later, I guess.
18:48:32
Xach
didi: erann gat's BB macro is like if LOOP was turned into a binding/nesting construct
18:54:50
dim
(subseq line 0 (+ -1 (length line))) ; am I the only one confused by the - operator enough so to do (+ -1 ...) ?
18:57:48
Shinmera
I sometimes use negative constants if there's more than one element in the addition
18:59:46
dim
Xach: what I really don't like is when adding a let and then all the code underneath moves, which means a huge diff instead of a +1 line
19:02:19
didi
dim: For lists, if I know I will keep adding things to it, I keep the closing paren by itself.
19:18:45
Fare
Note that I don't claim nest is a macro to use everywhere, just that it's sometimes very useful in circumstances where the alternatives like metabang-bind don't convince me.
19:25:02
didi
Fare: I'm unversed on lisp and scheme macros, but your post got me thinking: man, scheme macros are complex.
21:45:46
_death
(defun elevator (number &rest divisors) (floor number (reduce #'* divisors :initial-value 1)))
21:50:29
stylewarning
shrdlu68: the hashlife algorithm from gospers compressing space and time paper
21:52:06
shrdlu68
Mine's so simple, no curses or implementation-specific stuff. and should run in any terminal with primitive support for ANSI control sequences.
21:56:16
shrdlu68
I know, wanted to make this with as little dependencies as possible, which is none.
21:57:35
stylewarning
shrdlu68: rake in all the deps you can get your mitts on! And help fix open source bugs...
21:59:14
didi
So I have a collection of elements that might have some duplicates according to a "samep" function. I want to merge these duplicate elements, by collecting their cdrs into an arbitrary element key. Say I have the collection ((a . resta) ... (b . restb) ...), and (samep a b), I want to merge a and b so the result will be ((a resta restb) ...). Is this a known operation? I am thinking of calling it `merge-duplicates'.
22:04:28
_death
stylewarning: too personal.. I'm guessing stuff on my github is like 10% of my code-at-home
22:04:34
drmeister
Does find-class need to be fast? What if I implemented find-class with an alist - I'm thinking about lockless data structures.
22:06:24
stylewarning
didi look at the function EQUIVALENCE-CLASSES here https://github.com/tarballs-are-good/quickutil/blob/master/quickutil-utilities/utilities/sequences.lisp
22:08:39
Fare
next year ICFP is colocated with StrangeLoop, and quite possibly the Scheme Workshop with it.
22:08:47
pjb
(mapcar (lambda (class) (cons (car (first class)) (reduce (function append) class :key (function cdr)))) (com.informatimago.common-lisp.cesarum.list:equivalence-classes '((1 a) (2 b) (1 c) (3 d)) :test (function eql) :key (function car))) #| --> ((3 d) (2 b) (1 c a)) |#
22:09:08
stylewarning
didi so the call will be something like (mapcar ‘combine-lists (equivalence-classes ‘samep list))
22:13:07
stylewarning
_death it would be cool if you tried to make some public. Most of my lisp-random is garbage
22:15:10
stylewarning
Gems like https://bitbucket.org/tarballs_are_good/lisp-random/src/a595eb662c2dce87f362dd0dd2541a93efe9c902/cxr.lisp?at=master&fileviewer=file-view-default
22:19:38
_death
stylewarning: I sometimes lisppaste/gist snippets.. as in your case, some of them grow to become libraries.. maybe in the future I'll decide to publish a "revised" history
22:50:04
_death
the gifs themselves are pretty cool.. e.g., http://london.harekiet.com/compo/index.php?nick=dila
2:00:11
emaczen
I have a cryptic error from SBCL which says: the value 65583 is not of type (UNSIGNED-BYTE 16) when binding SB-ALIEN::VALUE