samth
2018-9-4 13:19:29

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


d_run
2018-9-4 13:37:30

ah great point, need to remember that’s there


d_run
2018-9-4 13:38:03

racket -l tests/racket/contract/all


d_run
2018-9-4 13:38:14

:face_palm:


blerner
2018-9-4 15:30:41

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)


samth
2018-9-4 15:39:32

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


blerner
2018-9-4 15:42:33

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


samth
2018-9-4 15:42:46

samth
2018-9-4 15:42:54

I think @mflatt is likely the person to ask


samth
2018-9-4 15:43:07

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


mflatt
2018-9-4 16:23:22

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


blerner
2018-9-4 17:09:05

Thanks


mflatt
2018-9-4 17:44:06

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


dthien
2018-9-5 00:41:09

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?


greg
2018-9-5 01:19:13

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


greg
2018-9-5 01:19:46

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



philip.mcgrath
2018-9-5 01:20:15

@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


philip.mcgrath
2018-9-5 01:21:10

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


david.alkire
2018-9-5 01:37:45

@david.alkire has joined the channel


greg
2018-9-5 01:39:47

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


dthien
2018-9-5 01:59:33

@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


dthien
2018-9-5 02:03:22

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


lexi.lambda
2018-9-5 02:06:16

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.


philip.mcgrath
2018-9-5 03:08:51

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.


dthien
2018-9-5 03:14:08

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?