freenode/#lisp - IRC Chatlog
Search
13:36:54
ruffianeo
yes - that is also not expected - yes the lambda produced by (between....) it is some kind of parser combinator
13:37:21
Bike
so i mean, what i'm saying is this has nothing to do with disassemble, it's just that your function itself hangs.
13:39:07
Bike
it looks like between and seq should return immediately, so maybe token or bamboozle is broken
13:39:41
ruffianeo
bamboozle is right at the top of the file - it just wraps the function given into a lambda and traces to stdout
13:40:16
Bike
i mean, just look at scan-variation, see what it's calling, figure out what could be hanging
13:40:25
ruffianeo
and that is the first case where there is mututal recursion of the resulting functions
13:43:01
Bike
lisp is an eager language. when you write (between (token "(") ...) token will be called before between is.
13:44:33
Bike
i tried (trace pgn-tools::scan-variation) and called scan-variation and it immediately started printing out infinite calls. it did not "hang silently"
13:45:13
Bike
and no, you can do this in lisp, you'll just have to put more thought into evaluation order, i guess.
13:45:26
Bike
if you wrap a call in a lambda the call won't be executed until the lambda is called. you can delay in that fashion.
13:48:16
ruffianeo
because it was the first time I tried to trace something and I might have messed it up somehow
13:54:20
ruffianeo
so I would do something in scan-black-move like (... (spaced (lambda (stream) (scan-variation stream)))?
13:54:50
Xach
if you find yourself doing that a lot, you can define helpers that make lambdas for you, too.
13:55:28
ruffianeo
yes I was thinking about a (defun delay-scanner (scanner) (lambda (stream) (scanner stream)))
13:56:57
Bike
if you do (delay-scanner whatever), whatever will be evaluated before delay-scanner is called
13:59:19
ruffianeo
in that parsec port to f#, they do some fancy forward-decl thing and they have it wrapped in some reference type
14:02:01
ruffianeo
that would also be an option here - (defparameter *scan-var* nil), then have the scan-black-move functions use that *scan-var* and I setf the *scan-var* once
15:08:01
mseddon
are there any particularly well written, idiomatic lisp projects out there that I can learn style from?
15:10:26
beach
And it is not hard to understand what it does. Just an editor buffer implementation, except highly optimized in terms of performance and in terms of multiple views.
15:10:42
mseddon
Actually I had to basically build a totally live lexical scanning text editor buffer on top of visual studio code to get sane lisp intentation for Clojure in Calva :(
15:12:33
mseddon
some day I hope to write a proper lisp / slime plugin for vscode, it will, alas, need to use something similar for now.
15:13:03
mseddon
(and if you modify the readtable, All Bets Are Off, because I have no idea how to handle that.)
15:14:29
beach
We will use Eclector to parse the editor buffer, so it will be the actual Lisp reader that determines the meaning of the buffer contents.
15:15:37
mseddon
cool. I had a couple of sneaky ways I could optimize that based on parenthesis links etc.
15:16:15
beach
mseddon: For each editing operation, it determines which (recursivce) READs might need to be called again, and it repairs the whole analysis incrementally.
15:16:57
mseddon
nice, yeah. That is nothing I got to, but I did at least glimpse that you could get there. It's vastly unexplored gold out there I think.
15:21:15
mseddon
btw a very good project would be a lisp Language Server Protocol to subsume regular swank in most modern IDEs and text editors, too.
15:22:36
mseddon
but yeah, it's still worlds better than the horror show editing lisp is currently in most editors.
15:23:56
beach
So Cluffer is an implementation of an abstract data type that I call "editable sequence", except that its protocols are adapted to text editors, so the sequence is in two layers: lines and items within a line.
15:23:57
beach
The test suite is particularly interesting in that it generates random operations for the real implementation, and the same operations on a trivial but slow implementation of the same protocols. It then compares the results. This technique for testing gives excellent coverage and is unlikely to miss any edge cases.
15:24:35
beach
mseddon: You should direct those people to the presentation by "Uncle Bob" that I referred to the other day.
15:25:06
beach
mseddon: He says that Emacs, because it is written in Lisp, will become better than every IDE out there.
15:26:26
chrsnjk
hi, about lisp reading in emacs, I recently tried to make "Smart syntax highlighting for dynamic languageCase: Common Lisp in Emacs" work, the code is somewhere on my laptop
15:30:34
chrsnjk
I believe it has its own code walker, with an environment that contains bindings (not 100% correct approach)
15:40:46
Xach
Ok, I have spent a little time making the errors that block quicklisp releases more clear at a glance!
15:41:34
Xach
http://report.quicklisp.org/2020-09-20/failure-report.html is the old version of my primitive report. it summarizes but it requires a bit of clicking around to find the real problems
15:41:52
Xach
http://report.quicklisp.org/2020-09-23/failure-report.html is the new version, where the critical info (hopefully) is all in one place
15:47:54
Xach
as i test newer SBCLs that break a lot, this may help focus in on the scope of issues.
17:24:40
PuercoPop
mseddon: there already is one iirc, cxxr has an LSP server, although it wraps swank.
17:26:08
PuercoPop
I thought of starting one to developer a decent VSCode extension for Lisp, but after I started writing the extension for VSCode I found out their extension API sucks and one can't even properly take advantage of their built in browser.
17:42:58
user51
is seibel's practical common lisp a good introduction? i already have some programming experience
17:45:16
mfiano
It appears fare-quasiquote broke varjo. That's unfortunate, since Baggers left Lisp about a year ago. I hope it doesn't get dropped.
18:06:31
jackdaniel
no, he is just focused on creating a (non-lisp) game, so temporarily he has less time for lisp
18:11:45
jackdaniel
this is of some relevance: http://techsnuffle.com/2018/12/07/reasons-why-lisp-games-suffer-corrections ; that said, it is offtopic, so I'm dropping the topic
18:31:43
dbotton__
user51: I am finding “Common Lisp Recipes” very helpful for code and grasping the mindset
19:11:46
user51
dbotton_: thanks. i switched to land of lisp, which is much less dry and also seems to have been reviewed by an editor before publishing.
19:26:47
dbotton
<user51> the idea was for code examples it is not really a first book to start with
19:31:05
minion
user51: paip: Paradigms of Artificial Intelligence Programming. More about Common Lisp than Artificial Intelligence. Now freely available at https://github.com/norvig/paip-lisp
21:11:50
ChoHag
Is there a way to do this without the eval: (define y 21)(define x 'y)(eval `(* ,x 2))