freenode/#lisp - IRC Chatlog
Search
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")?
20:16:51
edgar-rft
gauss: PAIP has some extensively explained examples: <http://www.norvig.com/paip.html>
20:17:51
skeuomorf
edgar-rft: I *knew* about PAIP but was sorta hoping for something more focused and concise, alas, if my search fails, guess that's wher I am going
20:20:18
aeth
gauss: CAS fit into two categories, symbolic and numeric. Symbolic was traditionally the domain of Lisp, and there's even one called Maxima that's still around today (but probably mostly out of date compared to some commercial or modern project)
20:21:19
edgar-rft
gauss, skeuomorf: the Axiom book has also lots of details, PDF free available under "Documentation" here: <http://www.axiom-developer.org/axiom-website/books.html>
20:22:19
skeuomorf
gauss: I have to clarify, I was wondering if someone was working on a modern CAS in lisp
20:22:26
aeth
You would probably need a team of about 10 people with mixed comp sci, mathematics academic backgrounds.
20:23:19
gauss
skeuomorf: Oh, I am just trying to get started learning the basics, that "handbook" looks very interesting, thanks
20:23:45
aeth
If you're doing it in pure Lisp, you'd probably need an SBCL developer on board, too, because there's almost certainly some things that need to be done at the compiler level to make CL more CAS-friendly.
20:24:02
skeuomorf
gauss: Since this is a lisp channel, you should also look at "The reasoned schemer" and "the little prover"
20:25:02
aeth
edgar-rft: I'm guessing modern would be something that used the last 27 years of research that has happened since the 80s ended.
20:27:36
skeuomorf
edgar-rft: I was speaking very broadly, I am not up to date on the advances that happened in numerical computing or automated theorem proving, but I am pretty sure there are significant advances
20:29:55
aeth
It doesn't help that this is at the intersection of computer science and mathematics. Plenty of mathematicians can't program and plenty of people with comp sci degrees don't do anything approaching advanced mathematics.
20:30:32
skeuomorf
if somebody is doing CS academically, they're probably doing advanced mathematics
20:32:15
aeth
Well, if you're doing numerical things, you're working at one of the intersections of math and comp sci (one of the other notable ones being logic)
20:33:51
skeuomorf
You could be doing a bunch of things e.g. (Foundations of Mathematics, Combinatorics, Numerical Optimization, Inference, ...etc)
20:34:40
Bike
you'd read like... whatever people are doing now... homotoype type theory? maybe that's out of fashion since i heard of it
20:35:37
skeuomorf
Bike: PAIP has symbolic math and logic programming (which touches on theorem proving a bit) iirc
20:36:33
skeuomorf
Bike: Hot topics regarding types nowadays are linear types, liquid types, dependent types
20:37:04
aeth
The 1980s and 1990s were all about OOP. The 2010s are all about types. I wonder what the new thing will be.
20:38:54
skeuomorf
Bike: Well, it discussed unification which you'll probably utilize in a proof assistant
20:41:52
skeuomorf
Re: Robust Software, I like this "rant" from one of the wizards https://groups.csail.mit.edu/mac/users/gjs/6.945/readings/robust-systems.pdf