sorawee
2019-9-29 14:40:58

What are the source of non-determinism in Racket (besides external processes and random)? In other words, if I have a program that sets random-seed and does not execute external processes or measure execution time, are the results of different runs guarantee to be the same?


sorawee
2019-9-29 14:42:22

Does hash iteration order depend on random-seed?


mflatt
2019-9-29 15:10:49

Hash table iteration can vary independent of random-seed, and eq?-based hash codes are non-deterministic. Thread scheduling is non-deterministic, but maybe you would count that as “measuring time”. The gensym function uses a global counter, which is not exactly non-deterministic, but it’s so easily affected by other things (such as loading slightly different code in slightly different ways) that it’s practically non-deterministic.


sorawee
2019-9-29 15:11:20

Thanks!


sorawee
2019-9-29 16:51:34

Is there a function that is just like read, but can handle #<unreadable>? (either resulting in a predefined value that says “I am not readable” or allow users to supply one)


sorawee
2019-9-29 16:53:21

My task is that I have a list of #<unreadable>, and I want to know its length.


soegaard2
2019-9-29 16:57:31

It would probably be best no to write unreadable values in the first place. Only idea is to fix the input first. Can you use regexp-replace* on the port first?


sorawee
2019-9-29 17:00:10

Hmm. Come to think of it, the file is really messed up. I don’t think regexp-replace will help, but I can also see that the read-like solution won’t work anyway.


sorawee
2019-9-29 17:00:29

Will try another approach. Thanks for helping!



spdegabrielle
2019-9-30 00:09:02

sorawee
2019-9-30 00:23:08

Yet another question: is there a program that analyzes LoC in Racket? Like, given an initial entry point, find all dependencies, and compute LoC, number of expressions, etc.


sorawee
2019-9-30 00:24:59

Hmm. This should be easy to program actually