freenode/#lisp - IRC Chatlog
Search
11:07:13
didi
Question: If you were writing an IEEE 754 floating-point reader, how would you deal with reading an infinity datum? That is, there isn't infinity in Common Lisp, so if you read one from a stream, would you raise a signal or return a keyword like :infinity?
11:10:12
aeth
didi: What I would do is I would do an operation that results in an infinity or NaN, and if the user is using float-features:with-float-traps-masked then the user gets it, and otherwise gets the error. https://github.com/Shinmera/float-features/blob/master/float-features.lisp
11:14:39
didi
aeth: There are. There are two and possibly properties for one of them. Anyway, thank you.
11:15:57
p_l
does anyone have a summary sheet for when one will get a newly consed object vs a copy? Recently found myself in conundrum like that where I couldn't figure out if I'm getting a new atom based on template value or modifying a literal :|
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 |#