freenode/lisp - IRC Chatlog
Search
11:44:06
phoe
Is anyone aware of some kind of server in Common Lisp that can accept an arbitrary number of TCP connections and pushes the messages it receives into some sort of queue?
11:44:37
phoe
I'm fed up with trying to write a robust one myself and I'd rather use a solution that doesn't break in subtle ways.
11:50:00
shka__
there are some tricky things in the API like dropping messages, high water marks but there is a plenty of people using this already so getting help should be simpler
11:50:34
pjb
phoe: Not at the level of TCP connection, but of IRC message, there's the botil example: https://github.com/informatimago/lisp/tree/master/small-cl-pgms/botil
11:50:51
pjb
phoe: https://github.com/informatimago/lisp/blob/master/small-cl-pgms/botil/design/f-botil.png
14:17:38
schweers
shangul: maybe you can create a large integer out of your fraction and emit it. placing the string "3." in front of it
14:20:15
jackdaniel
common lisp has bignums, *yes you can* ,) admittedly that depends how much memory you have on your system
14:20:53
White_Flame
if you multiply by 1000, for instance, then FLOOR it to an integer, the rendering of it might be "1234567" which would correspond to "1234.567"
14:21:54
White_Flame
that would be your input requirement, in this case "I want 3 decimal digits of fractional precision"
14:22:26
jackdaniel
shangul: I think you need to be more precise with "what you want" before anyone can give you better hints on how to do that
14:22:30
White_Flame
and you could go as high as you want, well beyond what built-in floating point gives you
14:23:35
White_Flame
the reason I asked about precision is that if your requirements fit in single or double floats, just use those
14:24:11
shangul
I'm trying to calculate Pi. I've written a function returning a fraction/ratio which is Pi but I'm not sure how can extract digits of Pi
14:26:48
shangul
White_Flame, the problem is that I don't know how many digits I want. In that case 1000 was just an example
14:27:06
White_Flame
however many iterations your calculation performs determines how precise it gets
14:28:24
schweers
This seems to be a case of not understanding the problem space well enough. This does not necessarily have to do anything with lisp.
14:28:59
White_Flame
well, with arbitrary precision floating point libs, there could be specifics about them
14:29:46
White_Flame
also, there are algorithms to calculate arbitrary decimal digits of pi, random-access style, iirc