freenode/#lisp - IRC Chatlog
Search
6:19:46
White_Flame
does the standard RANDOM functionality allow seeding the random state in a way that is reliably repeatable?
6:21:34
no-defun-allowed
I don't think the nature of the random number generator is specified in CL, so there can't be a number that maps to a random state.
6:21:59
White_Flame
yeah, it seems that the only thing you can do is grab the current, or make a new fully randomized one
6:22:23
White_Flame
but I'd like to seed it in some way that, regardless of restarting the image from scratch, it can generate a repeatable sequence
6:22:33
no-defun-allowed
At least on SBCL, CCL and CLISP, you can print the random state readably though.
6:23:19
White_Flame
(making a another-language-in-CL, where that language wants an int-seedable PRNG)
6:48:17
Shinmera
White_Flame: you can't do that portably, and that's the primary reason I started writing some RNGs myself.
7:31:37
aeth
if ECL and SBCL can seed RNG, and you don't care about the seed being portable, then you could write a portability library around seeding (SBCL's random seed is pretty straightforward)
7:32:12
aeth
and that portability library would work on every implementation if it just falls back to not doing anything if it can't seed
7:48:34
jackdaniel
one thing is that to my knowledge distribution of rng's is uniform and I'm not aware of cl implementations allowing changing that
7:48:49
jackdaniel
so if you need non~uniform distribution indeed writing a library seems to be the best choice
9:06:00
tfb
White_Flame: all implementations can print random-state objects so they can be read in the same implementation
9:13:55
tfb
I guess I don't understand the requirement to seed the PRNG from an integer. That means it can only have as many bits of state as are in a (presumably) fixnum
9:14:32
tfb
But to answer your original question: yes, you can seed a CL RNG in a way which is repeatable in an implementation, just not with an integer
9:14:44
tfb
I guess I don't understand the requirement to seed the PRNG from an integer. That means it can only have as many bits of state as are in a (presumably) fixnum
9:17:27
tfb
Shinmera: CL has that (within an implementation). If you want cross-implementation portability you necessarily have to use a common PRNG algorithm
9:17:32
White_Flame
I mean sure, an integer is as arbitrary as any random-state object. But given source code that seeds with an integer, I can't convert that into a random-state object sensibly
9:18:57
tfb
White_Flame: yes, obviously you're just dealing with a language with a deficient spec, that's just going to make life hard.
9:37:04
White_Flame
These ,@ clauses should line up, shouldn't they? Does Tab align them probably in your emacs/slime? https://pastebin.com/hSdMmWET
9:58:41
White_Flame
If one of my macro parameters is a backquoted list, can I append to it and add comma terms somehow portably?
10:00:06
no-defun-allowed
Though fare-quasiquote replaces the quasiquote reader macros with something consistent.
10:05:55
White_Flame
ACTION is moving from triple-backquote to double-backquote and making it less general in order to work
10:07:56
no-defun-allowed
ACTION moves away from White_Flame, unsure how triple backquote was an attempt to start with
10:08:26
MichaelRaskin
Judging from painlessness of it for Agnostic Lizard, I think that most of the options are relatively sane
10:08:52
White_Flame
no-defun-allowed: macro which takes backquoted clauses and builds up a defmacro-building defmacro inside it
15:36:47
thijso
Is hashtable access and manipulation thread safe? Or is that implementation dependant?
15:45:30
beach
asdf_asdf_asdf: I am not sure whether you saw my remark to you the other day. I was saying that, if you submit code for others to read, you should make sure it respects established conventions in terms of naming and indentation. For example, CamelCase is not used in Common Lisp, and instead, words are lower case, and separated by a hyphen.
15:48:21
beach
asdf_asdf_asdf: Exactly what I said. Don't use CamelCase like ThisThingHere. Write this-thing-here instead.
15:49:06
beach
asdf_asdf_asdf: And we don't use the `@person' convention here in #lisp. Use `person:' instead.
15:49:49
beach
asdf_asdf_asdf: You can do what you want, but then keep your code to yourself and don't ask for remarks on it.
15:57:14
beach
asdf_asdf_asdf: I am terribly sorry. I thought you asked for remarks because you wanted your code to be scrutinized by #lisp participants so that you could improve it. I was wrong. I won't make that mistake again.
15:57:38
ck_
what is an instruction which needs to between two sets? How do you between in the first place.
16:09:15
asdf_asdf_asdf
https://www.hackerrank.com/challenges/between-two-sets/problem?h_r=next-challenge&h_v=zen
16:18:20
ck_
Wow "hackerrank", that sounds pretty elite. I think I am not qualified for this. Good Luck!