Search
Monday, 25th of September 2017, 9:51:48 UTC
12:16:40
Ellenor
** NICK EllieIsNotATeach
12:17:06
EllieIsNotATeach
** NICK Ellenor
13:36:34
Xach
So gitlab @ common-lisp.net is down right now, and I'm not sure to whom I can report this.
13:36:34
minion
Xach, memo from phoe_: http://paste.lisp.org/display/356788 <- What do you think of this? It's surprisingly small.
13:38:57
lacedaemon
Xach: #common-lisp.net
13:41:27
dlowe
woah, woah, WOAH. Periods in channel names?
13:43:03
Shinmera
dlowe: Channel names can have any ASCII character except space, bell, nul, cr, lf, or the comma in it.
13:43:19
Shinmera
At least if anyone actually followed the RFCs.
13:44:29
dlowe
I'm surprised we don't see a lot more domain names as channels.
13:44:48
Shinmera
Shorter names usually win over fancy characters, I guess.
14:13:12
Guest72992
** NICK karstensrage
14:13:42
karstensrage
** NICK Guest14297
14:16:12
Guest14297
** NICK karstensrage
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
14:42:27
dlowe
that's an odd failure mode
14:44:37
_death
maybe it was kept so the joke could keep going ;)
14:47:56
fouric
it should have been #9,001 imo
14:48:47
fouric
(i agree, that's a weird way to react when asked to join a nonexistent channel)
14:55:10
_death
http://paste.lisp.org/display/356837
15:00:54
jdz
Not sure what one would expect in a channel called #cracking4newbies...
15:02:42
_death
jdz: it used to be the go-to place for people interesting in reverse engineering :)
17:08:45
dlowe
Implementing "defer" from the Go language: http://paste.lisp.org/display/356846
17:08:58
dlowe
random thought that crossed my mind.
17:09:31
takitus
defer: Because functions need lots of hidden state :)
17:10:04
dlowe
if the hidden state in defer bothers you, you should make smaller functions.
17:10:57
dlowe
Anyway, it sure beats objects with destructors.
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:22:26
takitus
It's a very imperative solution to a very imperative problem :)
17:29:58
dim
dlowe: we have unwind-protect
17:30:05
dim
and we hide it in with- macros...
17:30:44
dim
I prefer with- macros using unwind-protect, that said, of course
17:31:31
dlowe
dim: if you had looked at it, you would have seen an unwind-protect form.
17:33:34
dlowe
takitus: the advantage it has over "goto cleanup" is that defers can be conditionally added
17:33:52
dlowe
whereas in a cleanup code section, you have to check for conditions to clean up on
17:34:33
_death
it reminds me of my old scopeguard-inspired implementation
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:35:53
dlowe
Yes, that with-* macro syntax is so bothersome.
17:37:02
borodust
woops, sorry, but hello anyway
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:39:34
takitus
dlowe: It's certainly better than those C idioms. defer still seems a bit dirty.
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:41:01
dim
ah and that's exactly what you said, after the "bothersome" line
17:41:39
dlowe
or GMDRTBS - Great minds don't read the back scroll
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:51:46
dim
I wouldn't be surprised to learn that Faré prefers complex code
17:54:55
didi
I've been using :test-not lately. Feels wrong, but also handy.
17:55:53
Xach
uint: hey, why did you delete your telnet server?
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:34:02
shrdlu68
didi: Nice, used to declare ignorable.
18:43:40
Xach
didi: that it works in SBCL is a bug.
18:43:49
Xach
didi: only in LOOP does destructuring to NIL ignore something.
18:43:59
Xach
this came up last week or maybe the week before
18:44:58
dim
it supports nil and _ for ignoring values
18:45:12
dim
and does it for multiple-value-bind and destructuring-bind and others
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:47:09
Shinmera
Which is to say, you read char by char and do the line conversion yourself.
18:47:31
Xach
Or you could use read-line and trim
18:47:47
didi
I found `metabang-bind', but didn't find `BB!!!'.
18:48:01
Xach
didi: the !!! means sarcasm here
18:48:08
Shinmera
just read-line will catch bad lines
18:48:09
dim
I think it was called chomp in perl?
18:48:31
didi
Xach: So is it called `BB'?
18:48:32
Xach
didi: erann gat's BB macro is like if LOOP was turned into a binding/nesting construct
18:48:38
Shinmera
as in, if you have just LF by itself.
18:48:48
Xach
it's part of his improvements to CL...can't remember the name of it
18:48:49
didi
Xach: Sounds intimidating.
18:49:06
didi
oic You are joking with me.
18:49:08
Xach
didi: i found code using bb very difficult to read
18:49:36
Xach
oh yes, it's ergolib, making common lisp ergonomic
18:50:05
Xach
https://github.com/rongarret/ergolib/blob/master/core/binding-block.lisp
18:50:17
Xach
so it's like metabang-bind meets nest, maybe?
18:50:39
didi
Looks like Fare's blogpost nest.
18:51:13
dim
so there's metabang-bind and let+ to do things “sanely”?
18:51:28
Xach
dim: I find the normal binding constructs sufficient
18:51:37
didi
Well, I'm just looking for discarding unused bindings for the moment. :-)
18:52:21
didi
Anyway, I have some code to refactor. ;-)
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:54:59
dim
Xach: me too, mostly. in some cases tho...
18:57:48
Shinmera
I sometimes use negative constants if there's more than one element in the addition
18:57:55
Shinmera
or the operation, rather.
18:58:25
Shinmera
If it's just one, then I would just use the 1- function, though.
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:00:09
dim
Shinmera: I keep 1- for mapcar and such
19:00:19
Xach
dim: it would be nice if diff highlighters could be smart about that
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.
19:25:25
Fare
well, my post is the worst case for scheme macros
19:25:44
Fare
the one-line in CL that turns into extra lines in scheme
19:26:22
Fare
the best case would have several layers of gensym boggling your mind.
19:26:38
Fare
replaced by trivial hygiene
19:27:20
Fare
but yeah, this also illustrates limitations of syntax-rules
20:15:49
Guest76567
** NICK karstensrage
21:36:32
shrdlu68
Is there something for copying multi-dimensional arrays in the spec?
21:36:52
shrdlu68
copy-seq only takes proper sequences.
21:37:42
stylewarning
But it’s simple to write with ROW-MAJOR-AREF
21:37:57
_death
there's also alexandria:copy-array
21:38:18
stylewarning
Isn’t Alexandria’s function the terrible one?
21:38:29
stylewarning
The DISPLACE-ARRAY hack?
21:39:21
stylewarning
Ah, maybe that was in the past.
21:40:19
shrdlu68
I just discovered row-major-aref.
21:40:32
shrdlu68
I have no more need for the monstrosity I had written.
21:40:49
stylewarning
Yeah copying an array without it is definitely an exercise
21:41:08
_death
an exercise in writing row-major-aref :)
21:42:24
shrdlu68
It's only a two-dimensional one, so a hack with #'floor does it.
21:45:17
stylewarning
What are you copying arrays for shrdlu68
21:45:42
shrdlu68
Nothing big, game of life :)
21:45:46
_death
(defun elevator (number &rest divisors) (floor number (reduce #'* divisors :initial-value 1)))
21:46:43
shrdlu68
The entire game is a two-dimensional bit array.
21:46:50
stylewarning
shrdlu68: you should check out my GoL sim
21:48:08
stylewarning
https://bitbucket.org/tarballs_are_good/lisp-random/src/master/hashlife/
21:48:23
stylewarning
Find the quadrillionth generation in the blink of an eye
21:49:57
shrdlu68
stylewarning: I think mine would take some time? How do you do that?
21:50:29
stylewarning
shrdlu68: the hashlife algorithm from gospers compressing space and time paper
Monday, 25th of September 2017, 21:51:48 UTC