freenode/lisp - IRC Chatlog
Search
19:45:17
hjudt
what can i do to completely delete a package? i have the problem that i deleted a package but when i try to reload it (ql:quickload :package), i get the error "The name xxxx does not designate any package. (Condition of type sb-kernel:simple-package-error)", backtrace starting with (sb-int:find-undeleted-package-or-lose "xxx")
19:47:52
hjudt
i have loaded the system before, i do not want to delete files, only the packages i created. but i guess i need to delete the "system" too?
19:47:53
dlowe
in lisp, a package is a bag of names, while a system is a set of build rules and source code
19:50:27
|3b|
loading CL code can make arbitrary changes to the state of the lisp image, so hard in general to undo that loading
19:52:18
hjudt
when i e.g. rename or delete a function or symbol, i usually can use fmakunbound/makunbound to get rid of the symbol. that works.
19:52:53
hjudt
i just don't want to do that manually for cleaning up, it is tedious. i thought deleting packages and reloading the system might solve it quickly.
19:54:05
hjudt
i also entered a few statements at the repl to clean up the history, in case it is not garbage collected.
19:54:46
|3b|
(it isn't 100%, since you will probably end up with various references to the old stuff, for example methods on generic functions from other packages specialized on classes from the 'deleted package')
19:56:07
hjudt
ok, that could be the case. i have three packages in my system, which use each other.
19:58:28
ym
Why there is an ability to return multiple values if I cannot directly pass them as function arguments?
19:59:51
hjudt
|3b|: at the moment no. i am unsure i could disclose it and most of it wouldn't be useful for anyone else.
20:01:03
|3b|
ACTION expects (+ 1 (floor 7 2)) being interpreted as (+ 1 3 1) instead of (+ 1 3) would be annoying
20:02:18
|3b|
and having to write (+ 1 (values (floor 7 2))) to just pass the primary value would be worse than having to do multiple-value-call on the rare occasions of actually wanting to add the remainder too for some reason
20:03:41
|3b|
many functions that return multiple values are used mostly for the primary value, and only a few uses need the extra values
20:04:44
|3b|
it seems wasteful having to wrap all of the common case in (values) to get rid of the extra return values, just to simplify the few cases where you want the extra values /and/ want to pass them as adjacent arguments of some function
20:05:39
sjl
ym: the values aren't returned as a list -- they're returned directly. So you don't need to allocate memory
20:06:03
sjl
Having to allocate a fresh cons cell every time you looked up a value in a hash table would be annoying
20:07:45
|3b|
having to pass (lambda (&rest foo) (car (apply 'some-function foo))) instead of just 'some-function would be rather annoying
20:09:29
|3b|
the responsibility to remember that gethash returns extra values, then wrap it in a lambda to call car on it when you want to pass it to something that only wants a single non-list value returned?
20:13:36
ym
Wrapping in lambda to get only needed value from list is work of programmer, optimizing the code - work of compiler.
20:14:05
|3b|
right, my point is that even if the compiler could optimize it, the code would be annoying and error prone
20:18:05
|3b|
because it is useful (and/or because it was in older lisps that were being standardized)
20:32:33
didi
Because of a discussion earlier, TIL (funcall (let ((*x* 42)) (declare (special *x*)) (lambda () *x*))) => UNBOUND-VARIABLE
20:36:41
Bike
i thought the idea was rather than the function doesn't close over the special binding
20:37:06
|3b|
actually, i guess that doesn't help that case, since the local binding exits before the call anyway
20:38:27
|3b|
don't need a declaration in the function, need an enclosing special binding around the call
2:36:22
jeosol_
is anyone running a web application and could show me their setup. Essentially, settings behind nginx, etc. My eventual is plan is to move to AWS where I have an instance with SBCL but I have not done much.
2:37:58
jeosol_
I have a bias for production web application and I want to start understanding what is involved so set this up.
2:39:03
jeosol_
but my question is around configuration and deployment, e.g., on AWS. I am able to run simple problems on my machine but want to start looking in the area of deployment.
2:39:06
onion
parenscript is also nice. i have only looked at erlang and haskell for servers before cl
2:39:28
onion
if its an sbcl image, you can connect emacs or other dev ide to it and develop while its up
2:39:49
rme
learningtouch.com is a CL-backed web site. It's hunchentoot running behind an Apache reverse proxy.
2:41:05
rme
If I was setting it up today, I might use ngnix, but there were already other Apache-hosted sites on the same machine.
2:41:54
jeosol_
why nginx? that would be better because I use that for my simple example, but have problems adding hunchentoot as proxy. I have only been able to get hunchentoot to work with apache2 in the past.
2:42:28
jeosol_
if you recommend, nginx, better then. I will just find a setup with hunchentoot as reverse proxy.
2:44:18
rme
Apache was easy for me to set up. Ensure mod_proxy is loaded, and then two lines in the config: "ProxyPass / http://127.0.0.1:9999/" and "ProxyPassReverse / http://127.0.0.1:9999/" and I was all set.
2:46:19
rme
Then there's a startup script (run from rc.local or something) that runs the ccl in a tmux session and then loads a little lisp file that configures and starts hunchentoot.
4:06:49
sukaeto
jeosol_: unfortunately, I can't show any of the code, but I maintain a Caveman2 application running behind nginx: https://github.com/fukamachi/caveman
4:07:38
sukaeto
in production, we spawn of some number (dependent on the number of CPUs on the host) of FastCGI workers, each in its own docker container
5:12:42
jeosol_
those running CL web applications, what do you framework do you use? Hunchentoot (raw), Weblocks, Caveman, ...?
5:17:31
jeosol_
Thanks @onion, I am assuming these are battle tested and can be used for serious production app?
5:18:27
jeosol_
I have a back end application and want to develop the front end part, also using React (recommended by some frontend guy, not an expert in this space)
5:18:30
onion
i think woo might be, i will be choosing that myself, ive seen it mentioned today or yesterday in some project
5:19:08
jeosol_
I did give a try in the past and it's the one I invested the most time when I was trying things out.
5:19:11
onion
for front end i will be using Parenscript myself. dont need react or anything, just canvas or GL here.
5:19:21
beach
No, I mean, check with Shinmera whether your potential choices are "battle tested, etc".
5:20:33
jeosol_
michaeljforter says he runs CL apps in production but I sent him a message on Reddit a while ago to see his setup but got nothing. I assume he was busy and forgot
6:31:40
didi
Hehe. I'm reading CLTL2 and this came to mind: (my-post-defined-fn (progn (defun my-post-defined-fn (x) x) 42)) => 42
6:55:08
beach
It can't evaluate the argument before looking for the function, because then it would not know whether it IS a function, and hence not know whether the argument should be evaluated.
6:56:10
didi
beach: IIUC, it can, because if it is not a special form nor a macro, it assumes it is a function.
6:57:13
didi
beach: I think it just assumes it is, evaluates the arguments, then try to find the function. CLTL2 says this is unspecified.
6:57:40
beach
didi: To find out that it is not a macro, it must query the environment with the function name. Which is what I mean by "look for the function".
6:59:48
didi
beach: I think I'm not understanding you. What I'm think of is (cond ((special-form-p x) ...) ((macro-p x) ...) (t ;assumes it is a function ...))
7:03:09
didi
If it's not a special form nor a macro, it assumes it names a function. It doesn't know yet there is no function named by the symbol.
7:05:09
beach
That's the function that the compiler calls to figure out whether it is a macro or a function or a special form.
7:06:05
didi
beach: It might call it /after/ it assumes it names a function and /after/ it has evaluated the arguments.
7:06:39
beach
Because it would not know then whether it has the right to evaluate the argument, because it would not know whether it might be a macro.
7:06:48
didi
Oh well. The program (my-post-defined-fn (defun my-post-defined-fn (x) x)) evaluated to MY-POST-DEFINED-FN, so I don't know what is happening then.
7:07:55
didi
beach: Sorry, I don't know how to convince you. The program runs and CLTL2 says it is possible.
7:08:43
beach
I am just saying that it has to "look for the function" first, in order to determine whether it has the right to evaluate the argument.
7:09:52
beach
There is only one mapping from function names to function-like things in the environment. That mapping could show that the name is a function, a macro, a special form, or that it is not defined as any of those.
7:10:19
beach
So that mapping has to be queried in order to determine whether it has the right to evaluate the argument.
7:10:48
beach
Querying that mapping is "looking for the function". There is no other way to figure that out.