freenode/#lisp - IRC Chatlog
Search
12:43:16
malice
Is this the proper approach and I've done some stupid mistake, or is the problem more complex or my approach wrong?
12:47:03
Bike
(defmacro debug-break (&rest args) (if *debug* `(break ,@args) nil)), then there will be breaks only if *debug* was true at compile time
12:47:22
malice
I didn't want to put it in code, just to use in REPL to try out the stuff. I'm not used to leaving hacks in the code.
12:48:03
malice
May I know why it won't work though? I thought that the call to BREAK would call my function, as the global definition is shadowed by the local one?
12:50:25
malice
Bike: so to make things clear, were this some other function, non-locked, e.g. #'FOO, the code would work?
12:52:54
Bike
if you do want something like 'special functions', you can just do like (defun foo (&rest args) (apply *foo* args)) and then bind *foo*
13:19:16
|3b|
instead of messing with the BREAK, you could add a handler to pick the continue restart automatically
13:27:44
elderK
Guys, when you're writing a new program, like, creating your own ASDF system and all, do you link your project's directory into wherever ASDF's source registry is?
13:28:45
elderK
After skimming the ASDF3 manual, I've just placed a bunch of prereq systems in ~/.local/share/common-lisp/sources. SBCL's happy and can find them all.
13:38:37
jmarciano
When I use my own ASDF system, how do I prevent this appearing WARNING: DEFUN/DEFMACRO: redefining function IN-USER-CONFIGURATION-DIRECTORY in /home/data1/protected/.cache/common-lisp/clisp-2.49+-unix-x64/home/data1/protected/lib/lisp/quicklisp/dists/quicklisp/software/uiop-3.1.7/backward-driver.fas, was defined in /home/data1/protected/lib/lisp/quicklisp/cache/asdf-fasls/0ktqad/asdf.fas -- do I need to clear Quicklisp cache?
13:40:54
jmarciano
I know what you mean thanks. Is this related to my private project or quicklisp cache?
13:46:10
jmarciano
I eliminated many of them by realizing I was using image which already had alexandria and some of :depends, but I still have warning left
13:48:04
jmarciano
if I understand well, if I quicklisp load "asdf", also uiop is loaded, so I do not need to mention "uiop" in system.asd
13:57:34
elderK
malice: I'd agree with you there. The only reason I ever use Clisp is to build SBCL.
13:57:58
jmarciano
and I am not sure, do I need to list all :depends or just one that asks others in chain.
13:59:57
jmarciano
malice: maybe is not, it just works and I use development version, even stable one works.
14:01:17
|3b|
elderK: it might be older than the groveller, and i don't thing the groveller would have helped with that anyway (and would mean people needed a working C compiler to load lispbuilder-sdl)
14:02:39
elderK
|3b|: I see what you mean wrt to requiring a C compiler. But other than that, I think the groveller would've helped.
14:03:00
jmarciano
I would like to remove WARNING: Adding method #<STANDARD-METHOD :AFTER (#<STANDARD-CLASS TEST-OP> (EQL #<SYSTEM "spatial-trees">))> to an already called generic function #<STANDARD-GENERIC-FUNCTION PERFORM> -- but I don't know where to start
14:03:40
elderK
|3b|: And aye, I'm not sure how old the Groveller is. Maybe you're right, maybe it didn't exist when LBSDL was being written.
14:06:02
jmarciano
if for example cl-ansi-text which I have in :depends-on also has :depends-on "alexandria" do I need to remove "alexandria" from my ASD file?
14:06:34
|3b|
you should depend on whatever you use, so you don't break if the other lib decides to change their deps
14:06:36
elderK
Out of curiosity, what's the usual... system... most people use for unit testing in CL?
14:08:34
p_l
elderK: I think RT is one of the oldest packages around, recall reading some paper on it that really dated it
14:08:53
malice
jmarciano: np. I would clear caches and see if it helps, but other than that, I have no idea
14:10:49
p_l
actually a lot of code is long-lived but usually hampered by dependencies that change under it
14:11:29
elderK
That raises another question: How does CL play with native functions that may block? Provided say, we're calling those native functions via CFFI from some thread, via say bordeaux threads?
14:12:11
elderK
p_l: I have no problem with old code if it works, works well. If it hasn't been changed, maybe it simply didn't need to? Maybe it was already perfect :)
14:13:44
jmarciano
I just see, if I remove for example "alexandria" which is anyway loaded by other :depends-on files I get less warnings
14:15:25
elderK
jmarciano: AFAIK, you want to specify *direct dependencies*. Not indirect dependencies.
14:16:44
jmarciano
but |3b| said I should define to what I depend on, in case other libraries change it.
14:17:10
jmarciano
and I see, if I do that cffi-manner it has less warnings, as it is not double loaded.
14:17:52
p_l
if you don't, but a library you depend on uses it, you don't include it in your system deps
14:18:10
malice
jmarciano: No, not really. You only specify your direct deps. If other library changes the deps, it's not your problem.
14:18:15
elderK
You can't control what other things depend on - and you shouldn't rely on it, either.
14:20:46
jmarciano
I was expecting then the ASDF to handle those matters automatically, for example why is ASDF then loading multiple times alexandria...
14:20:49
malice
elderK: I've heard nice things about prove. I've been using fiveam myself, but prove has better support for Roswell
14:21:32
elderK
roswell's nice for automating installation of implementations, as well as setting up stuff like quicklisp, right?
14:22:38
elderK
I don't use QuickLisp - I was wondering if that's a kind of outmoded way to do things these days.
14:25:11
elderK
Anywho, still curious as to how threading works via bourdeaux threads, with respect to native functions that block.
14:26:35
elderK
And you when you interface with stuff like epoll, you have to let their runtimes know that it's a blocking call and such.
14:27:29
malice
I see. I haven't been using these threads directly, so I don't know, but I believe they aren't green
14:29:01
elderK
Another question! (Sorry, I'm full of them. I *am* looking at existing projects to try and learn but... you guys are here... so...)
14:29:27
elderK
What's the best way to pass say, a buffer that's a vector in CL, to native code? I've seen things like static-vectors about.
14:29:45
elderK
Or if you'd just foreign-alloc a buffer and use that instead of using CL vectors at all.
14:30:42
elderK
Maybe these questions aren't so important. It's just, I come from C. So, naturally, I've very interested in issues of interfacing CL ro it.
14:32:55
akr[m]
Hello, I wonder if someone could help me with a build error from buildapp/asdf I'm getting. The error is `Component :DE.SETF.AMQP.AMQP-1-1-0-9-1 not found` and it's caused by `--eval "(asdf:operate 'asdf:load-op :de.setf.amqp.amqp-1-1-0-9-1)"` argument to buildapp. Strangely enough, I stared getting the error when I've checkout out another git branch, however when I've switched back to the original branch where it was working,
14:34:20
pjb
Probably, this exact version is not available from the quicklisp distribution in quicklisp anymore.
14:37:29
pjb
Then inspect ~/quicklisp/local-projects/ and any other place configured in asdf for your local systems. Install manually de.setf.amqp there (~/quicklisp/local-projects/).
16:32:26
jmarciano
I would like to understand why is this warning coming up seemingly randomly. http://paste.lisp.org/display/350928
16:33:13
jmarciano
I can turn on some of those :depends-on files, and will get other similar warnings, and I tried to isolate it, but it happens too often.
16:36:11
loke
although, interestingly enough, there have been commits to the source repository last month
16:42:55
jmarciano
on the other hand, SBCL does not load that file, complaining about EOF, while clisp does load
16:50:02
Bike
the warning in your paste is just from https://github.com/edicl/cl-ppcre/blob/master/cl-ppcre.asd#L83-L85
16:53:46
Bike
ppcre's code is not a bug. clisp's reacting to it with a warning is silly but not a bug in clisp exactly, i guess.
16:56:13
aeth
iirc, clisp is maintained enough to get new commits, but not maintained enough to get a new release
16:56:47
aeth
I always check github because there's usually a github mirror if the project's not there
16:57:29
aeth
This mirror has Mar 24 as the last commit, which doesn't mean that's the last actual commit. https://github.com/rurban/clisp
16:57:49
jmarciano
CLISP is running pretty well, it is mature software, while I run development version.
16:58:27
aeth
The source of that mirror is hg and says "2 weeks ago". http://hg.code.sf.net/p/clisp/clisp
17:03:23
jmarciano
by the way I am willing to find programmer to convert some C++ mathematical formulars to Lisp
17:03:50
jmarciano
I would pay few hundred dollars for the job to get it done properly, even who knows to read C++ this could be just few hours of work (or few days)
17:06:44
aeth
You might have to modify it a bit to get it to work for you. I did. I am not the originator of that script. Iirc, someone else in #lisp is.
17:12:28
aeth
Unrelated trick, but something I find very uesful is to do this if you're using the REPL as a calculator instead of to write programs: (setf *read-default-float-format* 'double-float)
17:13:07
aeth
In a program, you might want the speed and lack of consing of single-float, but quick REPL usage probably requires doubles to get the right answer.
17:28:33
aeth
It has a lot of calculator stuff (e.g. mean, binomial-coefficient, factorial) and a lot of stuff for quick programming one-liners (e.g. curry/rcurry)
18:09:34
jmarciano
I would need to construct all variables and functions, like list of it to get better completion.
18:11:47
aeth
*slime-repl foo-lisp* with paredit (or something similar) is basically everything that one needs, and then some
18:12:34
Bike
(do-external-symbols (s :cl) (fresh-line completions) (write (symbol-name s) :stream completions))
18:20:24
jmarciano
That makes sense, than each implementation with rlwrap or rlfe can have symbol completion and history.
18:40:34
Bike
(defvar *alphabet" "abcdefghijklmnopqrstuvwxyz") (defun alpha-code (char) (position char *alphabet*)) (defun code-alpha (code) (char *alphabet* code)) (defun caesar (string n) (map 'string (lambda (c) (code-alpha (mod (+ n (alpha-code c)) 26))) string))
18:40:54
aeth
All you really need is an incf-mod/decf-mod for that, e.g. https://gitlab.com/mbabich/cl-brainfuck/blob/master/brainfuck.lisp#L22-33
18:42:09
aeth
I prefer to implement incf-mod/decf-mod and mod+/mod- (in several places actually, I should make a library) because I think tiny helper functions/macros that express things exactly are more idiomatic Lisp.
18:43:40
pjb
Bike: you have to take into account non-*alphabet* character to encode caesar. Either filtering them, or leaving them alone.
18:49:10
aeth
pjb: what I'd probably do is use code-char and char-code to have the A-Z, a-z ranges (although this non-portably assumes that the char-code/code-char system has A-Z in a row and then a-z in a row)
18:50:01
aeth
One could also set different ranges to cycle over, and non-portably assume unicode or something.
18:53:45
aeth
actually, you'd only need the #\A and #\a if you assume they're cycles of 26 characters with e.g. a at (+ lower-case-a-position 0) and the last at (+ lower-case-a-position 25)
20:45:54
jmarciano
is there a way to get LISP result in Emacs buffer directly just like I can do it with Emacs Lisp
20:48:49
jmarciano
I know it is beautiful in the clouds, but when you are too long there, you miss the earth.
20:50:09
Bike
i don't... are you saying i'm stuck up? it's not like the repl isn't available to you either
20:51:17
jmarciano
I do use REPL all the time, more than SLIME, it depends if I am writing something or calculating, or running some programs
20:52:44
jmarciano
I need less then a second to open REPL, and I need way longer to come into Emacs, Slime, to get REPL, makes no sense.
20:53:19
jmarciano
My REPL is bound to C-t l in stumpwm, and it just comes up, less than a second, with all the functions prepared.
20:55:06
Bike
i think you need to do, uh.... (slime-setup '(slime-repl)) in your emacs configuration
21:08:23
jmarciano
It somehow makes sense to run Window Manager in SBCL, where runs Emacs and CLISP in background.
21:11:45
tetero
jmarciano: Oh I typically tend to split when I have more than one window, and mode-line helps if you're into that
21:12:34
jmarciano
My laptop is smaller for splitting. And I enlarge all letters to watch easy from more than 1 meter with extended keyboard.
21:16:18
tetero
Although, what is it that you need to copy/paste between? Your terminal and most apps should support that
21:16:25
jmarciano
(define-key *root-map* (kbd "=") "rcd-paste") I have that like this, but is not getting into terminal
21:34:55
PuercoPop
jmarciano: you can use the xtest extension to send mouse clicks from lisp. its implemented in CLX
21:40:21
jmarciano
I don't need a mouse, programs need a mouse more than me, like some make programs for sake of programs, and not of people.
21:55:59
phoe
beach: You have your style guide in the SICL repository. Do you think you could extract it into a separate document?