freenode/#lisp - IRC Chatlog
Search
22:15:58
rpg
Fare: I think that ACL ELI's way of doing this was better -- record the source file and then parse it at search time (with the ability to specify defining forms for things like your DEFUN*). Recording textual position is super-brittle if one interactively compiles forms (as, being someone who learned to program on a Symbolics, is something I do *all the time*).
22:16:37
rpg
Recording source file position is great for C, but for a non-batch-compiled language... meh
22:19:44
rpg
luis: BTW, the other long-deferred PR is one that fixes compilation from strings on Allegro.
22:20:18
pjb
rpg: true. However, lisp projects still contain a lot of static and rarely changing code. So this can still be useful 90% of the time even with lisp.
22:23:13
luis
rpg: slime's find-definition doesn't rely on position alone, so it deals perfectly well with chaging source files
22:23:48
rpg
luis: Does it? I find that for example, my compiler warnings start to wander around the file after a number of C-c c
22:24:32
luis
rpg: that's because you're using ACL and a 6-year-old SLIME :) I've fixed that in the meantime
22:24:36
rpg
I think my patch for ACL addresses this by spoofing file names (from the buffer file) when compiling interactively.
22:25:02
rpg
I don't think my SLIME is actually 6 years old -- just my PR. I have rebased it a few times since then.
22:26:09
luis
rpg: I've fixed a bunch of bugs with ACL warning positioning somewhere in the past 2-3 years
22:36:18
ralt
if someone has a hardcoded .so file somewhere, and loads it with cffi:load-foreign-library, does it become a system library?
22:42:49
luis
fe[nl]ix: what's the foreign-library type for? Yet another undocumented feature by young fe[nl]ix :)
22:45:17
yottabyte
question on yason and drakma: this works: (yason:parse (drakma:http-request "https://jsonplaceholder.typicode.com/posts/1" :want-stream t)) but if I don't have the :want-stream t, it fails. but I thought even without the :want-stream, a flexistream is returned
22:49:58
no-defun-allowed
yottabyte: possibly as one of the other values, but it may be closed already as Hunchentoot consumed the contents from it
22:55:24
Fare
if rpg is ok with expanding the with-upgradability into a tens of the same, then fine. IIRC, that slowed down compilation a bit, but that shouldn't matter much.
22:55:57
Fare
It's mostly, do we want to rewrite every defun into a defun*, every defgeneric, maybe every defmethod, etc.
22:56:44
rpg
Fare: If this can be automated, or if someone else does it, fine. But I don't have a weekend to spend grinding on that by hand.
22:58:21
Fare
luis: it might be that the support for :supersede t / nil is what's breaking things, but it looks like this support is not really used anymore in ASDF3, so could be done away with.
23:00:02
rpg
I haven't counted, but presumably the CHARACTER-OFFSET is to the start of the initial WITH-UPGRADEABILITY, not the nested DEFUN.
23:00:22
Fare
This were necessary when upgrading from ASDF2, something less and less relevant, and I believe not used anymore
23:01:03
luis
rpg: the character offset seems to be from the beginning of the file excluding whitespace and comments or something weird like that
23:02:25
Fare
problem: to actually test that nothing is breaking, you must identify the worst old implementation / old asdf combination.
23:06:15
yottabyte
no-defun-allowed: the return of the Drakma request isn't a string without :want-stream t. it's a Flexi-streams either way seemingly. yason can work with json strings, though
23:09:45
luis
Fare, rpg: so, understandably in retrospect, SBCL stores the position of the nearest read (i.e. non-consed) form. And that's with-upgradability.
23:11:06
rpg
luis: I guess what I don't understand is that if that's all it does, why is there even a FORM-PATH?
23:36:46
luis
Fare, rpg: mutation works. (defmacro sort-of-like-upgradability (&body body) (setf (first (first body)) 'defun*) `(progn ,@body)) not sure what the spec has to say about it, though.
23:47:49
Fare
I'm pretty sure the standard says that it's unspecified what happens if you modify a source form.
23:51:29
Fare
IIRC, the problem that the EVAL-WHEN is fixing is to handle the case where an old ASDF compiles a new one, hasn't loaded it yet, and now tries to use the CLOS functions that are super confused between the old and the new state. And then there's the case when the gf is defined in one file, but some of the methods used by ASDF are defined in the next file, but are not available anymore (and that's why we use concatenate-source-op).
0:04:33
luis
but that's not a problem for find-definition. defclass and defmethod, it's when the macro discards the defun cons and replaces it with a new defun* cons that we get into trouble
0:05:06
luis
so if defun* actually accepted the defun form as input and included it in the expansion that'd work
0:05:07
Fare
well, it will still do it, but this the toplevel read form will have only one thing in it, no problem.
0:07:55
Fare
there are historical reasons why the forms are grouped in a common eval-when, but I don't think there is any current constraint why they must remain so.
0:09:11
Fare
if the forms are separate, then no matter how confused SBCL is about the macroexpansion, it will remember the position of the toplevel form, which will happen to be the location you need.
0:10:14
Fare
it's the grouping that's an issue, not the eval-when as such. You could have individual eval-whens.
0:11:03
luis
ok, I see what you mean now. Still, find-definition would still point at with-upgradability instead of defun. It'd be a little bit less wrong, but still wrong.
0:18:08
solrize
does anyone know if there's a way to increase the max allowed recursion depth in clisp ?
0:27:12
solrize
dlowe, hmm that's the process stack, i'll try that but i didn't think that was the issue
0:43:36
Fare
These days I'd don't push code to master or merge things anymore (though I occasionally still push documentation tweaks), so you'll have to wait for rpg to press the button.
8:03:17
Willi-Smith
Hi, can somebody explain me error "The function SB-EXT:DISABLE-PACKAGE-LOCKS is undefined." when I'm trying "(ql:quickload :ltk)". Run by cl-launch. Thanks.
8:07:42
phoe
sb-ext:disable-package-locks is a SBCL-specific declaration, not a function, so using it as a function is invalid anyway
8:13:44
Willi-Smith
I'm very beginner in lisp and this is my first project with GUI. I need some lightweight environment so I chose cl-launch with sbcl (on arch linux). For run project I use 'cl -Q --source-registry /home/william/.local/share/common-lisp/source: "%f"'. In source folder is unpacked ltk. I guess I'm wrong with my approach.
8:15:08
no-defun-allowed
Huh, the symbol sb-ext:disable-package-locks is present here but not fbound.
8:15:54
no-defun-allowed
I suppose it is; I thought it was once a function, and I think the ltk author must have too.
8:18:23
Willi-Smith
LTK is downloaded from: http://www.peter-herth.de/ltk/, I expect cl-launch uses system sbcl which is sbcl-2.0.3-1
8:22:17
phoe
https://github.com/herth/ltk is where Quicklisp pulls its versions from, so it should work on SBCL 2.0.3
8:30:21
Willi-Smith
Now I can quickload it without error. Last thing is how can I start using ltk package? After I test (ltk::ltk-eyes) this error shows 'READ error during COMPILE-FILE: Package LTK does not exist.'
8:30:51
ym
Hi. I have a simple expression: (mod (apply #'+ angles) (* 2 pi)) ; it returns value > 2pi in some cases. Is it rounding problem?
8:33:50
Willi-Smith
Do I need to create .asd system file for my project or can I only quickload ltk in my .lisp file?
8:34:35
White_Flame
regardless of how it's loaded (and completely regardless of how your other stuff loads), once LTK is in the package should exist
8:37:07
fe[nl]ix
phoe: I statically linked it to libfixposix (git), libcrypto and libssl 1.1.1g, upgraded ASDF to 3.3.4
8:38:39
phoe
does it mean that CFFI is automatically instructed not to look for these libraries externally?
8:39:33
Willi-Smith
This simple .lisp example gives me error "(ql:quickload :ltk) (ltk::ltk-eyes)" > Package LTK does not exist.
8:39:46
fe[nl]ix
phoe: that said, you can simply comment out the loading in the respective sources (cl+ssl or iolib) if you want to play with it
8:42:18
phoe
Willi-Smith: I have no idea what cl-launch does nor I have ever used it in my life; I'm a SLIME user
8:43:53
phoe
nothing I'd like to use if I was beginning to learn, especially if I wanted to use the interactive facilities that Lisp provides
8:44:25
Willi-Smith
I chose it because I can simply run lisp from bash. It works well but Im confused about package importing. It has bad documentation.
8:45:36
no-defun-allowed
I would advise against running Lisp like a "batch" compiler, as using it interactively will make you much more productive and make programming easier.
8:46:26
phoe
so you might find little support for it - there's few people who do it that way and therefore few people who can advise you with that programming style
8:46:52
no-defun-allowed
Willi-Smith: Trust me that you would benefit from interactivity, unless you are able to reason about your entire program without needing to consult a computer.
8:49:19
no-defun-allowed
And even then, you would work faster with interactive tooling; there isn't a reason not to want interactivity.
8:49:51
Willi-Smith
I tried atom with slime but it wasn't so straightforward as this simple bash launcher. I've never worked with emac. Do you recommend me to give it a try?
8:50:33
White_Flame
emacs+slime is the best supported environment for working with Lisp, both the repl .lisp and files, and their interaction
8:51:08
phoe
The idea behind Lisp is that you never really kill or close the Lisp program while you're programming. You instead send commands to the Lisp program that define functions, variables, modify things, or just cause some stuff to happen like (print "hello world")
8:54:12
Willi-Smith
Shall I go with this emac how to https://lispcookbook.github.io/cl-cookbook/emacs-ide.html ?
8:54:16
phoe
ralt: nope - the possibility to transfer running code from one Scheme image to another fully at run-time, stack and continuation and everything.
8:55:51
ralt
Ah, I meant more the concept of having a process that never dies, ala what used to run on mainframes, so that you can take full advantage of instance upgrades and stuff, but abstracted away by the kernel to trust it to run forever
8:59:19
White_Flame
yep, if you've not used emacs before, it's probaly the easiest way to get it up and running with everything
8:59:51
ralt
One thing I really like with this concept is that you no longer need a database, you can store everything in defvar or whatever, and that's effectively persistent
9:01:58
ralt
I would argue most people don't understand how transactions work anyway, so you're making it easier to understand
9:03:55
no-defun-allowed
cl-worlds is an implementation of the "worlds" concept proposed by Warth, Ohshima, Kaehler and Kay for "controlling the scope of side effects".
9:05:22
no-defun-allowed
The basic idea is that one can "sprout" a world from the current world, perform some changes in the world, and then commit those in an atomic manner, after checking that no slots that the computation has read have been changed. Oh, and it lives at https://gitlab.com/Theemacsshibe/cl-worlds or https://github.com/nodefunallowed/cl-worlds
9:05:43
solrize
do most ppl here use slime? do you have it set up so that it launches an inferior lisp as soon as you visit any .lisp file?
9:07:06
solrize
thanks, i got the autolaunch code from someone here and it freaked me out at first, but i see some point to it. other thing i notice is i have to restart slime a lot when the inferior lisp resets... is that an issue for you? i had never used slime before quite recently
9:07:19
phoe
solrize: yes and no, I launch slime manually at the start of my emacs session if I am going to work with lisp stuff
9:07:37
no-defun-allowed
I use a custom metaclass that stores (changed) object slots in a hash table in the current world, so no.
9:09:00
no-defun-allowed
That might make accessing slots somewhat slower, especially if one is accessing a slot bound many parent worlds away for the first time. (After that, however, it'll be cached in the current world.)
9:13:49
no-defun-allowed
ralt: I would suggest skimming http://www.vpri.org/pdf/tr2011001_final_worlds.pdf for the space and time properties of worlds; my implementation is a rough translation of the algorithms in section 5.
9:17:41
ralt
no-defun-allowed: thanks, I actually did something similar for work, except I did a copy of the top-level container and used immutable objects inside
9:19:31
ralt
It effectively means a cheapish clone operation at first and then basically zero overhead
10:08:20
phoe
nope, it establishes a restart allowing user to set the place with a new value and retry the assertion
10:08:51
phoe
the type designator that is passed as the second argument to CHECK-TYPE stays constant
10:09:51
shka_
well, my issue here is that when check-type is used in the top level function, it is obviously very useful and restart helps
10:10:56
shka_
however, when used in a inner function, restart becomes misleading, because value was passed from the above, and therefore error was made before calling the inner function
10:11:36
phoe
yes, if you do (defun foo (x) (check-type x ...) ...) then the restart stores the value in the variable X
10:12:56
phoe
the STORE-VALUE restart in such context effectively becomes a USE-VALUE one since it only allows the function to be called once; the stored value may then discarded when the function exits and the local variable X goes out of scope
10:14:10
phoe
using CHECK-TYPE in such contexts becomes more meaningful if you have places that are more persistent, such as (defun foo (x) (check-type (slot-value x 'my-slot) ...) ...) since then the value is *actually* stored and remembered even when the function quits
10:14:31
phoe
and, honestly, I don't really know how to work around that limitation in the general case