freenode/#lisp - IRC Chatlog
Search
15:31:05
rumbler31_
hey everyone. After perusing the latest quicklisp dist update, I am reading this code and trying to figure out what it does. https://github.com/Hexstream/enhanced-typep/blob/master/main.lisp
15:32:42
rumbler31_
it appears that if the argument is a constant, then a lambda is returned that tests a random object var against the specified type, otherwise
15:35:01
rumbler31_
the code looks deceptively simple and short but i'm having trouble figuring out what it does, and what machinery behind define-compiler-macro makes it necessary
15:39:26
adlai
rumbler31_: it's worth noting that code using define-compiler-macro should always have identical correct behavior when the forms defining the compiler macro are deleted
15:40:09
adlai
no guarantees about consistent failures, nor efficiency; although, compilers are allowed to ignore define-compiler-macro
15:43:08
adlai
ACTION begins to experience anger after too much time reading common lisp in github's website, and finds himself nostalgic for paste.lisp.org
15:43:57
rumbler31_
running the code in the repl was illuminating. I see that we are returning forms, not the lambdas themselves
15:44:35
adlai
correct, the function in question builds a lambda form, that can be compiled into a function
15:45:20
adlai
you may want to avoid thinking of the given arguments as "random", and instead just call them the given object name, and given type name.
15:49:02
adlai
rumbler31_: the author[s] have published their own chat website, in another repository under that same account, in case you want to contact them directly; although please remember to update, in here, if you learn something surprising in answer to your questions there
15:50:39
rumbler31_
I'm trying to play in the repl to understand the output of the function a little better
15:51:56
adlai
the function in question probably returns a lambda form, instead of a literal function, to avoid preventing serialization of compiled code.
15:52:58
adlai
yes; if you modify the code you are running so that it returns #'(lambda ...) instead of '(lambda ...), it will return a literal function object
15:53:18
adlai
that will work when you test it interactively, although it will almost certainly fail in certain compilation scenarios.
15:54:04
adlai
ACTION forgets the precise syntax for doing this bad idea with quasiquote, although it is probably `#'(lambda ... ,etc)
16:02:34
adlai
I hope you aren't also trying to unread projects that are removed from quicklisp... that is the garbage collector's job, not yours.
16:06:17
adlai
ok, read all of scalpl. it is terrible code, hitting almost all the nasty twisted corners of the standard, and it works.
16:07:29
adlai
if there is a specific part of the standard that you wish to see in use, please designate it.
18:11:57
daphnis
what's the cl equivalent of echo foo >bar, where bar is a named pipe? (with-open-file (s "bar" :direction :output :if-exists :supersede) (format s "foo")) doesn't seem to work.
23:39:26
no-defun-allowed
I would say that your IRC client uses lists somewhere, but IPL "invented" lists so it wouldn't be much of a point.
23:48:53
aeth
honestly, this is some weak trolling... if you want to troll better, pretend to be a paul graham fanboy
23:53:55
no-defun-allowed
Yes, I used a program written in Lisp to emit a Java program that had ASCII art in it for a Java assignment.
23:54:31
no-defun-allowed
Though pedantically that was Unicode art, I used the box drawing characters to make each 2x2 block of pixels into one character.
0:02:49
no-defun-allowed
That raises interesting questions about what constitutes "source code" for that course. That was generated code (and it had a "written by PROGRAM-NAME.lisp, do not edit" header) but I didn't get into trouble for submitting that.
0:03:27
no-defun-allowed
And I ended up changing it to 2x4 or something because most terminal fonts are taller than they are wide. A fun hack nonetheless.