freenode/#lisp - IRC Chatlog
Search
5:07:46
no-defun-allowed
SBCL runs fine on Windows from my (limited) testing. You can install Portacle and get the install over with quite quickly from portacle.github.io
5:08:07
no-defun-allowed
Windows doesn't have a package manager, so it's probably the most convenient way to get SBCL, Quicklisp, Emacs and SLIME.
8:10:55
flip214
When using 5AM in a loop, is there some way to name the current iteration? If there's an error then "X evaluated to Y which is not Z" doesn't help that much without the loop iteration or similar data.
8:27:03
flip214
jackdaniel: ah, right. Yes, I can annotate each IS test in there with the iteration value -- but then I loose the "expected/got" output!
8:29:39
flip214
What I'd like to have is some (let ((5am:*test-iteration* (list "my test ~d: ~a" i args))) ...) and have that FORMATted on failures as well (or at the first failure in that loop)
8:44:04
no-defun-allowed
is there a way for FORMAT to emit a newline if and only if the formatter is past 80 columns or so?
8:46:22
no-defun-allowed
well, i'd prefer at the end of objects, so i can have one print-object method that emits #<type :foo [long foo] [newline] :bar [bar]> or #<type :foo [short foo] :bar [bar]>
8:49:42
jackdaniel
(interesting fact: stream-column-number may return NIL, so do not assume it to be always a number)
14:13:29
devon
But I've read it several times and I'm still not sure I've parsed the prose as intended.
14:16:33
jackdaniel
devon: most likely, there is no context for what you said right now on a page or two of the history
14:17:22
devon
I presume it's ok to destructively modify the output of (format nil ...) but CLHS seems mum on the topic.
14:20:41
sjl_
someone else pointed me at that months ago when I had the same question. just passing it along.
14:28:16
flip214
jackdaniel: a stealth mixin to 5am, to provide the extended reporting? yeah, why not?
14:33:44
jackdaniel
flip214: then you could mix a class with slot iteration* to fiveam::test-failure with :initform *iteration* and define a method reason on said class which: calls next-method and then prints whatever you wanted to preserve
14:40:04
flip214
my plan was to bind some variable to some explanation; when a test fails, this content would be printed out first (once only!)
14:42:35
jackdaniel
I doubt it, recently I've ordered a bucket because plate is not enough to have things on it ,)
15:19:24
sjl_
something like (do-external-symbols (s :alexandria) (when (fboundp s) (print s))) will get you started
15:19:51
beach
trafaret1: OK, so how about you tell us which "package" you want this information about?
15:20:47
beach
trafaret1: I am introducing too much noise here. I'll leav you in the capable hands of sjl_.
15:21:52
sjl_
beach is correct in that packages in common lisp are containers for symbols. wrapping your head around symbols is one of the trickier parts of CL if you're coming from other languages.
15:22:28
sjl_
but if you just want to say "what new functions can I now call if I import package :foo", the snippet I mentioned above will help you out
15:23:45
sjl_
a symbol in common lisp is an object like any other. most programming languages try to hide away their existence from you
15:26:11
sjl_
especially if you're coming from Python, where something like "if foo: ..." is parsed into some kind of abstract syntax tree by Python that you never get to see/worry about
15:28:03
sjl_
but, to maybe clarify what beach was getting at: a symbol in CL can name many different things. For example, you can have a class and a function with the same name:
15:29:27
sjl_
You can't export just one or the other from a package, because packages are containers of symbols. You export the symbol foo, not the class or the function it names.
15:30:24
sjl_
so the snippet I pasted: (do-external-symbols (s :alexandria) (when (fboundp s) (print s))) says "for each exported symbol of the package :alexandria, if it names a function, print it"
15:31:14
sjl_
Which does (I think) what you were originally asking for (minus the parameters bit, which you can use describe to get at, though I think that might be implementation dependent)