libera/#commonlisp - IRC Chatlog
Search
9:07:40
beach
lukego: Yes, I think source information will be lost since it is specific to the SBCL reader. Eclector uses a different (better) system called Concrete Syntax Tree, but that's optional, and incompatible with the SBCL evaluator.
9:09:47
beach
Of course, there is no longer any particular reason for a Common Lisp implementation to use an implementations-specific reader, so perhaps you can convince the SBCL maintainers to use Eclector instead. :)
9:11:43
pve
lukego: At least I'm able to jump to location from the debugger, and M-. to functions, so I don't know if much has changed.
9:11:44
beach
ACTION makes another futile attempt to cut the collective maintenance burden of maintainers of Common Lisp implementations.
9:15:10
lukego
beach: well you have people wanting your stuff now, it just might takes us a while to figure out how to use it :)
9:16:00
beach
lukego: Yes, that's a good start. Though, I insist that Eclector is no longer part of "my stuff". It is almost entirely the creation of scymtym.
9:17:40
pjb
greyrat: you cannot access the lexical scope with a macrolet as you envision. The problem is that macros are expanded at compilation-time, but your loop is evaluated at run-time.
9:20:13
greyrat
How do I loop on a list of lists? In the ith iteration, I want to have a list of all the ith elements.
9:22:13
beach
At the very least, we should try to convince the SBCL maintainers to allow the use of Eclector as an optional reader for things like COMPILE-FILE.
9:23:21
pjb
greyrat: if the number of lists is less than call-arguments-limit (minimum = 50) - 1 then: https://termbin.com/t8nd
9:24:31
greyrat
pjb: thanks. What if it's bigger than that? Should I iterate on the index itself manually?
9:25:37
pjb
greyrat: certainly not on the index, since that would automatically multiply the complexity by n!
9:26:49
pjb
greyrat: you can replace some by every if you want to stop on the shortest list, instead of the longuest. mapcar and the other map functions in CL stop on the shortest.
10:09:24
greyrat
Using sly, how do I see the stdout of the evaluation? `sly-eval-print-last-expression' inserts them in the current buffer, but I want to see them in a new buffer. (Of course, I can write my own wrapper around sly, just asking to see if there is already a ready solution.)
11:35:13
greyrat
I think i found the answer: (defun foo (mandatory &optional (optional1 nil optional1-supplied-p)) ...)
11:36:25
rotateq
if you don't need the predicate, then (defun foo (x &optional y) ...) is totally good
11:37:08
rotateq
but sometimes you want the intention when y stays being a list, so (defun foo (x &optional (y '())) ...)
11:40:51
rotateq
some days ago someone in #clojure said, in elisp the else clause for IF has implicit progn and concerned that a `cool feature` but it's not good at all and inconsistent
11:41:48
lisp123
rotateq: It may look strange but there's nothing bad about it, saves a user from having to write out the progn for it
11:44:29
lisp123
Well it saves the progn, its just that we are used to the symmetry on the CL side (which I think is better)
11:45:08
lisp123
After all RMS did write the GNU compiler so I don't want to throw stones at elisp too much :)
11:47:19
rotateq
and symmetry breaks might be good in nature and physics, to have some matter be left over
13:35:42
semz
pjb: Good point with the logging system. Keeping a bit of memory around specifically for these situations is starting to seem like the only real solution...
13:42:13
pve
lukego: It occurs to me that if we relax the readtable that "forwards" to eclector a bit, then jumping to location ("v") from the debugger will take me to the correct (nested) form.
13:42:37
pve
https://github.com/pve1/eclector-access/blob/master/examples/slots-and-accessors-test.lisp
13:51:19
pve
rotateq: the page for intersection says that EQL is the default, but set-difference says nothing, that's why I was wondering
13:52:48
rotateq
pve: and now more explicit what I asked myself, for what the heck :test-not was by hysterical raisin
13:54:26
yitzi
pve: I use it in common-lisp-jupyter if you are curious to do code inspection, code completion, code reading & compilation in clasp, and recreating source code maps for sbcl, cmucl, ecl and ccl.
13:55:11
specbot
Satisfying a Two-Argument Test: http://www.lispworks.com/reference/HyperSpec/Body/17_ba.htm
13:55:17
pve
I seem to remember that some page somewhere said that unless otherwise stated, a test defaults to eql, but I could have been dreaming
13:57:03
beach
rotateq: It is widely accepted these days that all those "deprecated" instances should be ignored.
13:58:38
rotateq
pve: And I had to recall that under EQL the comparing of two strings gives NIL, even if they have the same content.
13:59:48
beach
rotateq: Not always. The compiler can sometimes optimize so that two strings become one.
14:00:06
pve
yitzi: so you can read *everything* with eclector, and still jump to location works for nested expressions?
14:03:45
yitzi
pve: There are several areas where Eclector is being used and some parts where the implementation reader is used. I'll give you a basic explanation...
14:07:13
rotateq
Like using SCHAR rather than CHAR when it's clearly of type SIMPLE-STRING and the index given isn't out of bounds.
14:07:42
yitzi
pve: reading and evaluation uses the implementation's reader and compiler. Implementations vary on what they report as the "source code location" though. I need line and column references to make the debugger work. For clasp I use an enhanced gray-stream under their eclector reader. For SBCL, CMUCL, ECL and CCL I use eclector to recreate a map from the implementation's source references to line/column if needed. For code inspection/completion I
14:07:42
yitzi
use eclector with a custom client that does not intern symbols and keeps the package names separate so I can do inpection and completion on those also.
14:12:17
pjb
greyrat: I don't know about sly, but in slime, C-u prefix will make slime-eval-last-expression insert the result in the current buffer.
14:14:45
yitzi
pve: no problem. And yes, it is kind of mess but having a debugger in Jupyter makes it so.
14:16:29
pjb
rotateq: emacs lisp being to program emacs is not a reason why emacs couldn't include a full fleshed Common Lisp; ancien lisp machines contained several different lisps. and there is a Common Lisp implementation in emacs lisp that worked before (ironicallyh) lexical binding was introduced to emacs lisp (emacs-cl); lexical
14:17:13
pjb
this could be revived, or another CL implementation could be ported to emacs lisp; perhaps sicl? Or we could also integrate ecl as an emacs lisp plugin, now that they exist.
14:18:53
beach
pve: For the SICL reader, we do the same thing as yitzi with the Gray streams. We have Eclector configured to create concrete syntax trees, and that's what the first pass of the compiler accepts.
14:20:07
beach
pve: And for the purpose of bootstrapping, we may have to configure Eclector so that it does not intern symbols in the host package system.
14:23:12
yitzi
clasp does essentially the same thing and as a result writing REPL that preserved source references for Jupyter was very easy compared to the other implementations. Looking forward to SICL!
14:24:10
beach
You are already using parts of if, since Eclector is definitely a SICL-related project.
14:24:46
beach
I mean, it started life as the SICL reader, and was then extracted and greatly improved by scymtym.
14:27:53
yitzi
beach: Well, that is true. And trust me, that is a big deal because there is a lot of tasks in common-lisp-jupyter that would be very difficult without eclector.
14:29:17
beach
pve: For example, in SICL, the source information is a quadruple: start line, start column, end line, end column.
14:30:20
beach
Eclector queries the stream for source information. By default the FILE-POSITION is used, but with a Gray stream, the client can choose the format.
14:31:27
beach
Client code defines a Gray stream class, and method on the relevant Eclector method that queries for source information, specialized to that Gray stream class.
14:33:01
yitzi
pve: Eclector's source query is from the `eclector.base:source-position` method. You can see use of it here if you want. https://github.com/yitzchak/common-lisp-jupyter/blob/c5531f60da0ec288a187a55ba699e38548233819/src/cl-jupyter/utils.lisp#L224
14:33:21
beach
pve: https://github.com/robert-strandh/SICL/blob/master/Code/Source-tracking/stream.lisp
14:34:42
beach
Actually, SICL is even more special. It reads the entire file contents into memory first, and then characters are read from the memory representation.
14:35:31
beach
It does this so that the source code of the compilation unit is associated with the compiled code, in the form of a vector of strings.
14:36:09
beach
That way, the file can go away, and we still have source location in the backtrace inspector.
14:36:54
beach
Unlike SBCL, where the directory belonging to Krystof can not be found on my machine.
15:35:54
scymtym
that's strange. references to SBCL sources are stored with logical pathnames. i thought there was no mapping to physical pathnames unless SB-EXT:SET-SBCL-SOURCE-LOCATION is called
15:36:41
beach
I am sure I have seen this pathname reference, but I can't remember the situation now.
15:47:23
lukego
pve: oh wow, is that example the whole implementation? I assumed the eclector extension was in another file but maybe that's it there near the top?
15:52:14
pve
lukego: yeah, the implementation is in another castle, but I think I could package the examples up into something easily loadable (and useable)
15:54:13
pve
lukego: the slots-and-accessors-test example depends on the eclector-access system (which in turn depends on eclector) and also the files symbol-patterns.lisp and slots-and-accessors.lisp in the examples dir