freenode/#lisp - IRC Chatlog
Search
9:09:26
waynecolvin
shaftoe : is this lame? (defun try-test (expr) (if (eval expr) nil t)) ~> (assoc-if #try-test '( (test-1 . 'fail-report-1) ... ))
9:38:41
Shinmera
Xach: I removed the Verbose kludge stuff from Qtools, so you should be able to cache fasls normally now
10:58:46
waynecolvin
is this less bad than using eval? http://lpaste.net/6726387104474988544 inverse-cond.lisp
11:00:14
beach
In recursive code like that, I always handle the base case first, i.e. if there are no clauses.
11:00:37
beach
Otherwise, you have your reader hold his or her breath until the end of the macro to see whether you actually plan to take care of that case.
11:03:44
beach
And your indentation is off. It looks like you are using Emacs Lisp mode. Use the slime-indentation contribution.
11:47:19
phoe
If you are using spacemacs, slime is already integrated in spacemacs's common-lisp layer - I am using this configuration at the moment.
12:50:17
toppler
Is there a library anyone can recommend for immutable b, persistent data structures in CL?
12:52:18
shka
if you like adventures, cl-data-structures: https://github.com/sirherrbatka/cl-data-structures but it is not stable, well tested on all platforms and documentation is fragmented
13:10:17
Shinmera
So #!+ is equivalent to #+ but using the target *features* rather than the host lisp's *features*.
13:11:35
Shinmera
The bang is there because if you're compiling from sbcl, the sb-sys package already exists
13:12:47
beach
And, of course, they don't have first-class global environments, so that can't do it that way either. :)
13:13:13
dmiles
well at this phase they are not yet SBCL.. they are whichever minimal lisp they are hosted on
13:15:45
dmiles
(well i mentioned that since to they'd need everyone elses lisp to have first class envs :P)
13:17:32
beach
There is no emulation involved. It is just a data structure from a library that the SICL compiler is able to use.
13:18:34
Shinmera
beach: Can't wait for all sorts of host weirdnesses to start becoming an actual problem building SICL :^)
13:19:09
beach
I haven't encountered any such problems, except the bug in SBCL that bit me and that had to do with funcallable-standard-object.
13:19:30
Shinmera
It took SBCL's devs quite a long while to get the resulting files to be binary-identical regardless of the host.
15:14:56
beach
What do you need them for? You just type `v' in front of the stack frame shown in SLIME.
15:41:17
Shinmera
Xach: Yes. https://github.com/Shinmera/qtools/commit/551bb9f6332eff4e16b99bfd83f50a94f65962af
16:20:37
flip214
is that an iterate bug, or do I have to tell the outermost iterate explicitly which block to return from?
16:24:34
beach
It looks like you gave the block an explicit name, distinct from nil, so then yes, you have to name it.
16:32:03
pagnol
beach, when I try to jump to my code from the backtrace I get an error 'unhandled DEBUG-CONDITION: #<SB-DI::COMPILED-DEBUG-FUN MINROOT> has no debug-block information.'
16:33:03
beach
pagnol: I have this in my .sbclrc: (declaim (optimize (speed 0) (debug 3) (safety 3)))
16:40:39
phoe
Unrelated: my life became so much nicer when I realized that I can (funcall (fdefinition (list 'setf FOO)) ...) where FOO is a symbol of my choosing.
16:43:22
Shinmera
It's a bit weird actually that function designators do not contain '(setf foo) despite '(setf foo) being a valid function name.
16:54:31
phoe
CLOS question - when I have class FOO, class BAR subclassing FOO, class BAZ subclassing BAR, and all three classes have INITIALIZE-INSTANCE :AFTER methods - when I make an instance of BAR, do all three methods get called by default?
16:54:35
beach
phoe: Speaking of which, KZiemian asked for input to CLUS, and I gave some, but then KZiemian has not been seen. This function designator could also deserve a not in there.
16:58:22
beach
The method combination builds an effective method that systematically calls all the application :BEFORE and :AFTER methods.
16:59:26
specbot
Standard Method Combination: http://www.lispworks.com/reference/HyperSpec/Body/07_ffb.htm
17:02:05
phoe
So INITIALIZE-INSTANCE uses a method combination to take other constructors into account? Like, in case of BAZ, constructors for classes BAR and FOO.
17:02:49
beach
It has nothing to do with constructors. ALLOCATE-INSTANCE is first called, then INITIALIZE-INSTANCE is called with the allocated instance.
17:03:24
beach
When the effective method is computed, all applicable methods are first determined...
17:05:40
Shinmera
You could always do the same thing done in other OOP styles by defining a primary method and calling CALL-NEXT-METHOD.
17:07:09
beach
Shinmera: The point is that doing so after the fact might change the protocol, so that client software needs to be rewritten. I asked that question in a course I held in New Zealand once. And they suggested exactly that. When I explained the maintenance problem, they immediately got it.
17:07:56
fourier
at some point Stroustrup wanted to add :before and :after into C++, and even had a prototype but then the community has decided it makes it too complex though
17:13:31
jmercouris
fourier: Is he the only one who decides the evolution of the language? is there not some sort of community?
17:14:16
fourier
no it was a commitee gathering like once a year. mainly lead devs, compiler devs and vendors
17:16:00
fourier
but until like 85-88 he had some freedom. then the language started to started to spread and he got bounded by "customers" and developers, hence all the stuff which is hard to remove/change
17:18:09
fourier
he has a huge influence on the language though, like he solely practically force commetee to accept STL - the part with iterators/containers/algorithms into the standard practically last moments after 2 days of discussions with Alex Stepanov who has implemented STL, then Stroustrup got the concept of it.
17:22:42
fourier
heh at least it evolves and into the good direction. it is so much easier to write code in c++ now after c++11/14. feels almost like a new language.
17:25:52
fourier
the language itself designed so you can use external gc, nothing to prevent it. the problem is no one needs it - people do manual memory management for reason.
17:36:27
fourier
can anyone explain what is the fundamental difference between Verna's quickref and quickdocs ?
17:47:18
jmercouris
I guess it's easy to get caught up in the echo chambers of the programming community sometimes
18:27:15
fourier
is where in CL or alexandria some function to create a sequence by repeating some element N times ? like (repeat "a" 3) => '("a" "a" "a")
18:27:35
flip214
in case someone is interested: quickdocs references https://common-lisp.net/project/quux-hunchentoot, but that is a 404.
19:31:43
phoe
What is a proper way to curry/rcurry something like (lambda (x y) (make-instance x :name y)) ?
19:48:37
Shinmera
(defmacro define-constructor (class lambda-list) `(defun ,(intern (format NIL "~a-~a" 'make class)) ,lambda-list (make-instance ',class ,@(loop for v in (lambda-fiddle:extract-lambda-vars lambda-list) collect (intern (string v) :keyword) collect v))))
20:01:02
makomo
does anyone have any recommendations where to look for good implementations of combinatorial algorithms?
20:02:10
makomo
algorithms such as generating all of the permutations, n-tuples, combinations (all w/ or w/o repetition), etc.
20:11:54
Shinmera
If I remember correctly Rosetta Code has some stuff, but I'm not sure if it's been translated to CL yet
20:33:32
makomo
if i have nested LOOPs, what's the best way to just forward the result of one of the the inner LOOPs