freenode/#lisp - IRC Chatlog
Search
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
10:16:11
shka_
i tend to use :before methods for validating arguments (it happens that i like OO style for interfaces) but i started to consider using :around instead
10:20:09
phoe
in initialize-instance :before the slots are not yet bound because shared-initialize was not yet run
10:21:12
phoe
I found that validation in :after for initialize-instance does not compose well when you have multiple :after methods
10:21:24
phoe
where the more specific ones depend on the values of slots validated in the less specific ones
10:23:50
shka_
i mean, you are often ending up with (defgeneric make-a-very-specific-type-of-object ...)
10:25:53
phoe
yes, that's the issue - the restart is meaningless and does not actually store the value in the object
10:29:49
phoe
I can imagine that it could be fixed if the variables bound by DEFMETHOD were actually checked at the end of the method and their values were passed to the next called methods; meaning, if a :BEFORE method could alter the values that are passed to next methods
10:30:33
phoe
portable code may depend on these bindings being fresh and therefore mutate them freely
10:30:55
phoe
ACTION adds this issue to the bucket of issues for the Hypothetical Revision of the Standard
10:54:33
ym
Is there some kind of macro extension library implementing typed declarations like for example (let ((foo :type fixnum)) ...)?
10:57:09
Xach
jackdaniel: http://report.quicklisp.org/2020-05-16/failure-report/mcclim.html#mcclim_test fyi
11:03:03
ym
I know that compilers like SBCL do all the magic inside, but I like to control the process, you know.
11:14:44
Xach
ym: I think there are some binding libraries that include type info in the binding. can't think of a specific one offhand though.