
@d_run also the .travis.yml file at the root of the repo has some good info on tests

ah great point, need to remember that’s there

racket -l tests/racket/contract/all

:face_palm:

General question to anyone familiar with the v6.12->v7 transition details: we seem to be hitting an odd problem using syntax-parameters such that they worked as intended (for us) in v6.12, and no longer work in v7. https://github.com/bootstrapworld/curr/issues/423#issuecomment-418379697 has all the info I’m aware of (I’m not directly involved in this issue, just cross-posting it here in case someone might know the answer)

@blerner is there a smaller example? I’m pretty sure some aspects of syntax parameters did change behavior in 7.0, though.

I really don’t know, sorry. Should I put Dorai in touch with you?


I think @mflatt is likely the person to ask

although @lexi.lambda and @michael.ballantyne may have thoughts

@blerner Offhand, it looks like a problem with syntax transformers and set!
– probably a bug in the expander, although it’s possibly in syntax parameters. The expanded code has (#%app the-unit-description the-unit-description ....)
, and I think it was supposed to be (set! the-unit-description ....)
.

Thanks

Looks like the problem is a missing (require (for-template '#%kernel))
in “stxparamkey.rkt”. I’ll test and push a repair later today.

Hi all, I’m trying to parse expressions with read-syntax
and specifically am trying to parse arbitrary-precision decimal numbers as literals. (i.e. I want to parse 1234567890.0987654321 and keep it in that format without converting it to a fraction or losing precision to floating point rounding.) Is there an easy way to do this, or a good way in general?

maybe (parameterize ([read-cdot #t])
(read-syntax 'source (open-input-string "1234567890.0987654321")))

That will be #<syntax::0 (#%dot 1234567890 987654321)>
and you can do whatever you want to do with the pre and post dot parts?


@dthien Not sure what you mean by “without converting it to a fraction”. If can read as an exact rational number (not floating-point) if you parameterize
read-decimal-as-inexact
to #false
: http://docs.racket-lang.org/reference/Reading.html?q=#%28def._%28%28quote._~23~25kernel%29._read-decimal-as-inexact%29%29

You might also be interested in the exact-decimal
meta-language: http://docs.racket-lang.org/exact-decimal-lang/index.html

@david.alkire has joined the channel

Whups, scratch the read-cdot
idea; not the intended use. Notice how it read
s each part, so loses the leading zero after the dot in the example. Never mind.

@philip.mcgrath I was running into issues with read-decimal-as-inexact
because I want to differentiate between an input that is 12.50
and 25/2
. I think that’s really the crux of the issue

I looked at exact-decimal
as well, but it looks like that reads everything as exact rationals

If you want to differentiate 12.50
and 25/2
, you’ll have to do it yourself with a readtable extension that reimplements number parsing.

And the built-in number datatype doesn’t have that distinction: > (and (= #e12.50 25/2) (eqv? #e12.50 25/2))
#t
In fact, with interned literals from the default reader: > (eq? #e12.50 25/2)
#t
So it sounds like you really want to implement your own number datatype with your own notions of equivalence.

Thanks for the help! If I want to do that in a parser, is there some sort of extension I can add to the existing read-syntax, or is this going to be it’s own reader?