libera/#commonlisp - IRC Chatlog
Search
10:37:03
knobo
When I build a lisp that has a (defvar x ...), then the value of x is determined at build time.
10:37:27
knobo
So I wonder if a statement like (defvar *dummy-sockaddr* (cffi:foreign-alloc '(:struct wsock:sockaddr-in)))
10:43:03
varjag
i think if your application keeps track of any system state, it has to be reinitialized (by you) upon the start
10:44:10
loke
But only the first time. Subseqeunt evaluations of the form will not change the value. If you want that to happen, you need to use DEFPARAMETER.
10:45:59
knobo
The struckt should be allocated when I load the source, and when I save the image, the alocated structure is saved in my lisp image?
10:47:58
knobo
So allocated memory should not be created with defvar if it should survive save-image?
10:48:27
loke
knobo: No it's fine. Whatever happened before the dump save whill have happened after loading.
10:50:54
loke
knobo: An image save is merely a core dump of the process that has been made to be runnable. So whatever is stored in a core dump will be recovered.
10:53:02
jackdaniel
FASL should be analyzed in term of *.lisp source precompiled a little to make it being loadable faster
10:55:43
knobo
I'm trying to figure out why woo fails when run from a saved image: https://github.com/fukamachi/woo/issues/51
10:58:16
knobo
But the strace shows that accept4 receives a pointer (like 0x641240) as argument from the saved image. On my saved image it receives a struct (like this: {sa_family=AF_INET, sin_port=htons(50068), sin_addr=inet_addr("127.0.0.1")}
12:18:59
HerrBlume
hey all, i am currenlty try to compile the iterate package on a current sbcl version
12:33:33
knobo
I installed a virtual server with ubuntu 16.04, and the saved image on 16.04 does not work. It works if I copy the image from Ubuntu 15.10 which I have on my laptop.
12:56:39
Guest44137
Hi, everyone, I have a newbie question, and didn't find a good way to google it, so I came here.
12:59:33
jackdaniel
using 'the' will only clobber the code. You may want to use it during some optimizations for the bottlenecks, but unlikely
13:02:09
Guest44137
Thank you again, jackdaniel. Problem solved: "Special Operator THE" should only be used when we need to do some optimizations for the bottlenecks.
13:02:24
ggole
the is only appropriate if you are happy with your program going bad if the type is not correct
13:05:40
jackdaniel
yes and that. Compiler will take your 'the' declaration at face value and if it's incorrect it may go really bad
13:15:02
Grue``
the compiler should usually catch the type mismatch (especially with constants), unless you have (safety 0) or something
13:36:26
scymtym
jackdaniel: that depends on the compiler and optimization settings. sbcl, for example, inserts type checks for THE forms in safe code (unless it can prove them to be unnecessary)
13:49:06
jackdaniel
scymtym: yes, but being thrown into debugger is something "really bad" if happens on the clients side
15:04:08
svetlyak40wt
Could someone tell me if there is some static blog/site bulder (in Common Lisp)? I'm looking something like Pelican or Octopress, but written in Common Lisp.
15:08:42
jackdaniel
there is also some wrapper around coleslaw (and a tutorial) here: https://gitlab.common-lisp.net/dkochmanski/sclp
15:08:51
phoe
I was about to write that they should message you about coleslaw details, jackdaniel :P
15:37:27
phoe
I'd do it either way just to make a small article describing what sorts of tiny utilities for lazy people can be done in Lisp
15:39:45
PuercoPop
phoe: consider sending your utils to quickutils instead of publishing a util library
16:00:35
phoe
PuercoPop: It's the kind of http://paste.lisp.org/display/321636 hacky utilities that are mostly syntactical shortcuts.
16:16:34
Grue``
if I were writing something like defprint, I'd wrap &body in (print-unreadable-object () ...) as well
16:22:56
oGMo
Grue``: in that case, never write any functions or macros or anything, because someone might not know what they do when you call them elsewhere
16:23:26
oGMo
also "defprint" is rather self-explanatory and if it's not obvious from context, look it up :P that's not really the issue
16:25:27
Grue``
there's a balance between code understandability and code elegance. I think macros that barely do anything harm understandability while not adding to elegance. if you're gonna macro, macro HARD
16:25:51
jdz
It's actually the other way around -- I find these small (and IMO pointless) macros annoying...
16:27:53
phoe
where I like the fact that I don't define an after method for initialize instance on an object of class my-class - I define a constructor for class my-class
16:41:22
Grue``
well, there are other problems with your macros. for example, defprint is anaphoric. if I use defprint from my package, the symbol OBJ in my package might not be the symbol OBJ from defprint's package
16:41:48
aeth
Easy or hard, I think macros make most sense when there's a clear pattern that's often used... e.g. a #h(...) reader macro for literal hash table syntax makes lots of sense, whether or not it's trivial in its implementation.
16:43:09
ggole
Although I guess an argument list could introduce enough inefficiency that you'd want a macro