freenode/#lisp - IRC Chatlog
Search
15:20:25
_death
#( is notation for vector, #. for read-time evaluation.. whether these constant values are available at read-time is another question
15:20:26
schweers
ebrasca: #() denotes a vector and #. is a reader macro which evaluates the following expression at read time..
15:26:40
White_Flame
(vector +opt-netmask+ +opt-ntp-servers+ +opt-router+) would work to construct the vector at runtime
15:26:43
_death
a simple (vector +opt-netmask+ ...) would be better style.. if needed, wrap it with load-time-value
15:33:52
schweers
It can be good for performance to evaluate something early. Basically the same reason why one might evaluate something at compile time (besides of course generating code).
15:36:31
sjl_
I have used it in (case ...) statements before where I want to substitute in a constant instead of typing in a raw integer.
15:43:08
schweers
Well. You can design a set of read macros and the like in order to read a syntax tree from C source code. But that alone is not enough to compile or even evaluate said code.
15:43:35
housel
If parsing C with readmacros were possible somebody would have done it in the past 30 years
15:46:08
sjl_
Xach: I've been sick the past few days, but I did get your ping about the pgp stuff. I'm still willing to be a guinea pig.
15:47:04
Xach
sjl_: thanks. right now i'm expanding from RSA-only keys and signatures to DSA and ElGamal keys and signatures. After that there might be something to play with.
15:47:45
Xach
I think I may factor this out into something standalone, too. It has IMHO useful compact/extractable SHA routines for one.
15:48:01
Xach
I like ironclad but it is very difficult to use just part of its hashing code. It's tied together.
15:48:18
sjl_
Yeah, those could be handy. Also easier to audit a standalone package if anyone ever decided to pay a security person to audit.
15:48:29
Xach
If you can accept not being as fast as ironclad I think a self-contained library to copy is useful.
15:49:53
sjl_
and how difficult it would be to find a security person willing/able to look at Common Lisp
15:58:58
_death
wonder what would happen if you place CL tasks on a site like fiverr.. with enough tasks, CL could become popular ;)
16:23:38
markasoftware
say I try to access the billionth element of a small circular array...will sbcl optimize it properly?
16:29:44
sjl_
You could probably do something clever by keeping tortoise/hare pointers as you go, and if you detect a cycle and still have N elements remaining back up and do the modulo version
16:30:23
sjl_
But that's a lot of extra bookkeeping for a pretty rare case, so it would surprise me if any implementations did it by default.
16:30:48
jackdaniel
by tartoise/hare you mean the algorithm where one pointer goes i.e by cdr and the second by cddr and testing for their equality?
17:22:25
pjb
(com.informatimago.common-lisp.cesarum.list:list-lengths '(a b c . #1=(1 2 3 4 5 . #1#))) #| --> 3 ; 5 |#
17:57:07
sebboh
I think a GC that can be disabled doesn't count unless there is a compelling argument that cycles and storage are simply not used in the first place when it is disabled.
18:01:48
didi
If I recall correctly, PAIP talks about not using the GC in some old implementations because they were inefficient, but I think they still had them.
18:33:59
sebboh
(Surely there are toy lisps that don't have GC. And to answer 'why?', I dunno, microcontroller?)
18:34:54
pjb
Try to write some lisp function without a GC (ie. by calling free for each cons, make-array, make-string, format, etc).
18:41:39
jackdaniel
pjb: that could be somehow made easier with enforcing object scope (i.e no function like #'cons but rather macro (with-cons …), or (with-objects ((a cons) …) …) not that I would be thrilled to use such system
19:02:24
p_l
what do you mean "read an unknown number of bytes"? With compile-time GC? You either ultimately use constant-size memory for this, or just ensure that you cons objects that can't have references and your compile time GC only tracks references (Rust model)
19:04:41
p_l
didi: your buffers can be compile-time known to have specific amount of references, you're tracking those references not memory
19:08:20
p_l
it simply had, iirc, two (maybe few more) areas that were fixed size at compile time, and used simple bump allocator inside of them (i.e. the "raise top of heap" pointer kind), with collection that worked by dropping a whole region
19:33:57
oni-on-ion
but since parens() survive by needing both an open *and* close, surely malloc/free under the same assumption could be just fine.
22:11:28
ckonstanski
Having an issue running a lisp process inside a docker container. Using SBCL. As soon as the lisp image is done loading and comes to rest at the REPL, the container dies. If I run the container interactively I cannot reproduce the behavior. Is there a trick to running a lisp image in docker?
22:18:26
rdh
is there good documentation and examples for OO? i'm reading Practical Common Lisp, and i'm not really grasping generic functions and how methods are "connected" to classes.
22:21:59
Xach
rdh: it can help not to think of generic functions as the primary thing, and classes as a convenient way to implement some concrete behavior.
22:22:23
edgar-rft
Fundamentals of CLOS -> http://cl-cookbook.sourceforge.net/clos-tutorial/index.html
22:22:30
no-defun-allowed
GFs are not connected to classes (except that they have a class, standard-generic-function) but they dispatch on classes (and eql values)
22:22:39
rdh
ohhhhhhhhhhhhh, methods are not really part of class objects... so i'm defining a generic way to use my object using methods
22:23:33
Xach
rdh: methods are not part of classes, classes are a way for a generic function to select what methods apply to a given set of arguments.
22:26:17
Xach
rdh: a generic function is like a thingy to which you attach methods. when you call a generic function, some (or none!) of the methods are selected to run if they match the arguments in some way.
22:29:22
Xach
if you define a method and it is selected, your object will be one of the arguments processed in some way by the code in the method. there can be many objects involved too - it's not helpful to think of an object as the "owner" of a method, it's just a participant in the selection of a method.
22:32:57
Xach
well, there are some good resources out there. try to avoid something that puts objects/classes first. it inhibits real understanding.
22:50:17
moldybits
i don't know if this is better, but at least it's more natural in clos to distinguish actions by how you name the function as opposed to letting the objects provide the context. (concatenate "a" "b") => "ab" (+ "19" "23") => "42"