

Please vote/comment

@spdegabrielle you missed https://news.ycombinator.com/item?id=31230504\|https://news.ycombinator.com/item?id=31230504

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

Now I need to see if anyone has posted on lobsters

Already posted by @popa.bogdanp ! https://lobste.rs/s/mkopf2/racket_v8_5\|https://lobste.rs/s/mkopf2/racket_v8_5

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

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

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.

Ok. Pros and cons i guess.

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).

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:

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

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

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.