freenode/lisp - IRC Chatlog
Search
8:20:02
fiddlerwoaroof
I think this is an interesting way of implementing extensible pattern-matching: https://github.com/fiddlerwoaroof/fwoar.lisputils/blob/master/patmatch.lisp
8:21:24
fiddlerwoaroof
Basically, you pick a symbol to use as the discriminator and then you use find-class and class-prototype to get the class named by the symbol. Then, you pass that prototype object into a generic function with the APPEND method combination
8:22:15
fiddlerwoaroof
That way, you can specify how the base class's slots are destructured in one method definition and how the class's slots are destructured in another.
8:23:25
fiddlerwoaroof
I don't think it's anything particularly special, but it seems to me that generic functions could be very useful for writing macros that need to be extensible
10:07:57
Xach
I don't know what spacemacs is, but in emacs in general, you push do this: https://common-lisp.net/project/slime/doc/html/Installation.html#Installation
10:10:53
akr
previous to this I actually tried to update slime in the project, but when I got the new version, compilation started failing
10:19:21
akr
when connecting remotely to a system running a certain version of SBCL, do I need the same version of SBCL on both machines?
10:39:51
akr
ACTION uploaded an image: slime.png (86KB) <https://matrix.org/_matrix/media/v1/download/matrix.org/IfTWORuFcqOZZiTDKcyNRHmN>
15:03:00
zulu_inuoe
Hello all. If anyone has experience using the fast-io library: How can I tell I've reached EOF on a buffer when using the multi-byte reads? the fast-read-byte function has eof-error-p and eof-value parameters, but I'm not seeing any such for the multi-byte reads (readu32-le, etc)
15:23:34
some-user
even slime-eval-last-expression-in-repl switches repl's current package to A eval exp and then switches back to B
15:26:04
Bike
paule32: i don't want to write your whole program. but you can use if for conditionanls, and eql to test whether two things are the same. that seems like it's probably enough.
16:29:32
some-user
how can i rewrite (let ((result '())) (loop for row in square do (loop for x in row do (push x result))))
16:34:18
some-user
pjb: Bike sorry, i'm using some processing before pushing x to result, failed to show it snippet sorry
16:44:14
some-user
is there destructuring-bind for loop? like (loop for x in xs for (a b) = in x) where x is '(1 2)
16:59:03
pjb
And since you're building a new list in the inner loop, you can use nconc instead of append in the outer loop.
17:07:22
pjb
paule32: I would advise newbies, as well as seasonned programmers, to fucking READ the error messages!
17:08:03
pjb
paule32: don't assign undefined variables! s0plus and computer are not defined. This code is undefined, it's implementation dependent.
17:09:01
pjb
paule32: also, it may be a good idea to compose paste.lisp.org pastes by using copy-and-paste of real sources and REPL output!
17:19:20
beach
paule32: How come you ask for advice here when it is perfectly clear that you do not follow the advice you are given?
17:23:12
shka
well, after chunks has been constructed, it may have label attached, and if label is present, it will be pushed into chunks-collection object
17:26:21
shka
if you are wondering how code looks like: https://github.com/sirherrbatka/cl-lore/tree/master/src
17:28:41
beach
I am glad at least one person understands what I am trying to communicate. That one more than my usual score.
17:30:04
shka
beach: well: 1) don't be so sure that i understand! :D 2) i think that you are excellent writer
17:43:10
aeth
shka: No penalty for trivial functions if you (declaim (inline foo)) before defun foo... So the style can be made to work.
17:46:27
beach
paule32: How come you ask for advice here when it is perfectly clear that you do not follow the advice you are given?
18:18:35
pjb
(defun .and (a b) (and (eq 'on a) (eq 'on b))) (defun .not (a) (if (eq 'on a) 'off 'on)) (list (.not (.and 'on 'off)) (.and 'on 'off)) #| --> (on nil) |#
18:41:37
pjb
paule32: it would be helpful and destressing for us, to know what you want to achieve exactly.
19:05:07
pjb
ok. Have fun. Also, read http://web.mit.edu/alexmv/6.037/sicp.pdf ; it has a section about such a simulator.
19:07:50
antoszka
paule32: also, that snippet of code is either missing a closing paren after the first if, or is indented misleadingly :). As pjb said it'd be easier if you told us what the intention is.
19:13:19
antoszka
paule32: please also join #clnoobs for basic learning questions, might be a better place for initial advice.
19:44:58
anticrisis
Is there an advantage to using the style where LABELS is used to create a single function for a recursive algorithm, versus recurring on the top-level function itself, or another top-level utility function? E.g. the GROUP and FLATTEN functions in LoL? I suppose it keeps the top-level namespace cleaner, but what does that matter since we only :export the main entry points?
19:46:41
Bike
anticrisis: there may also be a performance advantage as the compiler has everything at once. but it's not a big deal.
19:48:05
H4ns
anticrisis: and if you want to close over local variables with mutual recursion, you need LABELS instead of FLET
19:52:46
aeth
I tend to use inlined trivial functions at the top level instead of flet. Recursive functions would complicate things.
19:53:45
aeth
If you think you need simple recursion, see if you can rewrite it with a 0-body do. Scheme actually implements do through tail recursion, and the transformation isn't that complicated.
19:57:55
jackdaniel
for sure construct one doesn't use often may look unreadable, but it's the audience problem (ever heard people complaining about "counting parenthesies")?