spdegabrielle
2022-5-2 16:47:22

Please vote/comment



spdegabrielle
2022-5-2 16:58:21

Yes Sam just told me on Twitter. I searched and nothing came up.


spdegabrielle
2022-5-2 16:58:51

Now I need to see if anyone has posted on lobsters


spdegabrielle
2022-5-2 17:01:07

laurent.orseau
2022-5-2 17:03:49

@ryanc Is this expected behaviour? > (~r 1234567890123456789.123) "1234567890123456768"


laurent.orseau
2022-5-2 17:07:37

Rounding error it seems. Though it’s different from what Racket prints: > 1234567890123456789.123 1234567890123456800.0


ryanc
2022-5-2 18:34:03

Well, I didn’t expect it :slightly_smiling_face:. It seems to be a consequence of the following: > (inexact->exact 1234567890123456789.123) 1234567890123456768 Here’s what I think is happening: • One view of a floating-point number is that it represents a set (an interval) of reals. The printer’s goal is to print some finite representative so that the reader can identify the correct set and produce exactly the same floating-point number. A secondary goal is to prefer zeros in “don’t care” positions to avoid misleading humans about how much precision is actually present. • Another view of a floating-point number is that it represents a specific rational number (calculated from the mantissa, exponent, etc). This example represents an integer, and inexact->exact is producing that specific integer. Arguably, ~r should be doing the first thing, but it’s doing the second thing instead. Mea culpa. On the other hand, this behavior is consistent with the docs sentence “The exactness or inexactness of x does not affect its formatting”, and the first behavior is not.


laurent.orseau
2022-5-2 18:45:05

Ok. Pros and cons i guess.


rajan.yadav
2022-5-3 04:36:05

Looking for some help on racket/place. First example on this page https://docs.racket-lang.org/reference/places.html demonstrates how we can send place-worker.rkt with entry point 'place-main to execute at places. This works well if I am working off the source code. But eventually, I need to create a distributable package and putting place-worker.rkt in that package as source code is not an option. Is there a way I can embed place-worker.rkt in some binary form or compiled module in the distributable package so that it can be found by launching code (the one that creates places, assigns work to them and collects results).


rajan.yadav
2022-5-3 04:38:08

Documentation does say that “The module-path argument must not be a module path of the form (https://docs.racket-lang.org/reference/quote.html#%28form._%28%28quote._~23~25kernel%29._quote%29%29\|quote sym) unless the module is predefined (see https://docs.racket-lang.org/reference/Module_Names_and_Loading.html#%28def._%28%28quote._~23~25kernel%29._module-predefined~3f%29%29\|module-predefined?).”

But I am not sure how to convert place-worker.rkt to a predefined module that can go in my distributable package.

Thanks in advance :slightly_smiling_face:


sorawee
2022-5-3 05:06:13

> putting place-worker.rkt in that package as source code is not an option Can you elaborate on why this is not an option?


sorawee
2022-5-3 05:08:06

It looks like if you compile place-worker.rkt via raco make, then you can delete place-worker.rkt and the resulting executable from raco exe would still run just fine


sorawee
2022-5-3 05:08:59

raco dist on the other hand is not happy with source code missing: it attempts to copy the source place-worker.rkt even though compiled place-worker.rkt exists.