libera/#commonlisp - IRC Chatlog
Search
20:56:22
recordgroovy
To go against email scrapers on the GitHub... I see no reason why this *can't* be done, right?
21:02:39
_death
interestingly, the glossary entry for "single escape" says "(In the standard readtable, slash is the only single escape.)".. but it's not slash, but backslash (2.1.4.6 has it right)
21:04:30
recordgroovy
I'm targeting it to be readable by humans and asdf, but not by generic scrapers.
21:04:46
recordgroovy
Enough backslashes would make it readable by asdf, but probably not humans without good effort
21:06:12
specbot
Single Escape Character: http://www.lispworks.com/reference/HyperSpec/Body/02_adf.htm
21:09:26
tfeb
ACTION is now planning a tool which will convert code with string literals into code which uses load-time-value in ... interesting ways
21:46:26
lotuseater
I asked myself, when I can do all sorts of symbol names between pipes #\|, how is this done by the reader, cause (get-macro-character #\|) => (values nil nil). also with #\: for reading in keywords. or is this hidden for purpose to not break certain stuff?
21:50:01
jcowan
| is a character of a special type: multiple escape. What it does is not done by the readtable. : is just a token character: its interpretation happens at a higher level.
21:51:45
lotuseater
it was funny some days ago as i showed someone the symbol '|This is a symbol, really, I swear.| :D
21:54:21
jcowan
Yes, it is. But \ and | are not implemented using readtable macro characters. You caan change what characters are used, but the behavior of single and multtiple escape chars is hardwired.
21:54:49
_death
you can (set-syntax-from-char #\| #\a) and then | is no longer a multiple escape character
21:55:39
jcowan
or (set-syntax-from-char #\$ #\|) and then $this is a symbol even though it doesn't look like it.$
21:58:18
White_Flame
of course, the readtable interface isn't always the easiest to extend for every language. Sometimes you need to go raw
21:59:43
jcowan
I should probably have said "non-CL Lisps". CLtL gives the example of !, which is the single escape char for Portable Standard Lisp.
21:59:50
lotuseater
or opening foreign files as streams, reading all lines and break up piece by piece
22:02:24
jcowan
The Compatibility Note at the bottom of https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node188.html explains how | is not a macro character.
22:02:28
lotuseater
so NASA calls you "we need a FORTRAN77 expert" so no problem, now we do Lisp (again)
22:13:32
lotuseater
oh I remembered reading about Symbolics they had their own Lisp implementations for compiling C, Ada, Fortran ^^
22:15:52
jcowan
I found a copy of CLtL2 for $34 at the awesome bookfinder.com (price includes shipping to me, so YMMV)
22:17:13
lotuseater
but also something like Feynman Lectures on Physics, Knuth's Concrete Mathematics or TAoCP, expensive ...
22:18:29
lotuseater
have found in the university lib in the book sale (every for 1€) an old version of The METAFONTbook
22:20:24
lotuseater
as much as a new game, but of course more substance: https://www.zvab.com/servlet/BookDetailsPL?bi=30210395030&searchurl=hl%3Don%26kn%3DConcrete%2BMathematics%26sortby%3D20&cm_sp=snippet-_-srp1-_-title2 (just as an example)
22:26:50
lotuseater
but now I found a big book (from 1996) about AutoLISP, could be helpful for the new potential job and I bet this small industry company still runs on much old stuff
22:35:34
lotuseater
moon-child: or finally doing this Hercules task and building a translator for COBOL to Java/C# or whatever banks/insurances mean is good
22:38:15
hayley
I read that it is made very complicated by having rational arithmetic (bad for Java, fine for CL) and being able to change GOTO targets on the fly (very bad unless you give up and compile basic-block at a time).
22:40:36
lotuseater
or the systems behavior must be changed safely stepping away from those hairy things
22:56:25
etimmons
Xach: UIOP 3.3.6 is on the way. Being tested on the systems not yet covered by CI. Will hopefully be out in a day or two
1:33:06
recordgroovy
Hi, I'm wondering if anyone could spare some time to peer-review a library I've been working on. Thanks for any comments :)
1:49:28
moon-child
recordgroovy: I am not so sure of the special-casing of eof. Usually it makes more sense to treat the eof as just another kind of token
6:34:49
phantomics
recordgroovy: Looks interesting at a glance, very neat code. I'll give it a try when I have time
7:25:25
pjb
lotuseater: I've seen big systems defining some dispatching reader macros on $ ; but nowadays, with unicode, you can more often just define a reader macro on a unicode character.
7:46:26
kakuhen
Is it possible for eval-when to implicitly modify arguments of functions like find-class?
7:47:18
kakuhen
I have a macro that transforms a given symbol and creates a class named with this transformed symbol, together with methods specialized on the class.
7:48:20
kakuhen
Say this transformed symbol is X. Both CCL and SBCL throw style warnings that my defmethod's are using the undefined type X, but the class was defined right before I define these methods.
7:49:53
pjb
kakuhen: not eval-when directly, but eval-when implies that the body will be evaluated in different environments, so it's possible that operators that may depend on the environment such as find-class give different results.
7:50:02
kakuhen
So I decided to wrap (defclass X () ...) in an eval-when form. Above in the macro, I check the output (find-class X nil). When I use eval-when, errorp somehow becomes T rather than nil
7:50:09
pjb
It should be the job of the programmer to ensure that the differences are not semantically different.
7:51:10
kakuhen
pjb: Yeah, I suspect eval-when implying a different environment somehow makes the arguments supplied to FIND-CLASS "flip," but it wouldn't explain why this issues goes away when I supply the environment.
7:51:49
kakuhen
anyway, I am trying this because SBCL and CCL are giving me style warnings (ECL doesn't give style warnings), and I assume it could be a bug in both SBCL and CCL's compiler, but I don't want to jump to such conclusions yet.
7:52:14
kakuhen
and I get strange behavior with FIND-CLASS when I include an (eval-when (:compile-toplevel :load-toplevel) ...) in the macro
7:52:26
pjb
You must be doing somethign strange, because a simple toplevel sequence of defclass defmethod should work nicely.
7:53:19
kakuhen
Anyway, I am trying to produce a minimal working example of the style warnings SBCL and CCL produce
7:53:33
kakuhen
SBCL produces twice as many style warnings as CCL, so it's catching(?) something that CCL isn't. Meanwhile ECL just gives zero style warnings.
7:53:48
pjb
kakuhen: so, your macro should expand to (progn (defclass x () ()) (defmethod moo ((x x)) …))
7:55:01
beach
kakuhen: The dictionary entry for DEFCLASS contains a phrase that makes its compile-time behavior very hard to understand.
7:55:37
beach
That might be the reason for the differences in behavior of different implementations.
7:56:23
beach
It is essentially impossible for an implementation to comply with what the standard says.
7:56:28
kakuhen
I see. And, before it gets asked, yes, I set the debug level to 3 before compiling on each implementation.
7:56:38
pjb
"If a defclass form appears as a top level form, the compiler must make the class name be recognized as a valid type name in subsequent declarations (as for deftype) and be recognized as a valid class name for defmethod parameter specializers and for use as the :metaclass option of a subsequent defclass. The compiler must make the class definition available to be returned by find-class when its environment argument is a value received