samth
2017-4-12 13:30:39

yes, you do need to worry about it


samth
2017-4-12 13:30:57

in particular, note that the CG-Fun rule assumes that the two functions use the same names for the variables


samth
2017-4-12 13:31:07

which means you have to rename to make that true


leif
2017-4-12 15:14:00

jerryj
2017-4-12 15:14:56

@leif Ah, yes this looks very useful indeed, thank you!


jerryj
2017-4-12 15:17:14

i had a very pleasant evening yesterday, simply stepping thru the debugger after entering simple exprs like (+ 0) in the REPL. its amazing how much you can learn just by watching it execute. i never got around to actually figuring out how to find the variable I was looking for :joy:


leif
2017-4-12 15:32:31

He, he. Which GC were you using?


jerryj
2017-4-12 15:49:47

cgc


jerryj
2017-4-12 15:52:54

I thought I could find it by searching for it in the environment, but, I don’t understand racket’s architecture well enough to know where to look for it (the reference to the environment that would contain the value i care about).


ben
2017-4-12 19:56:00

@stamourv thanks for merging #1665


stamourv
2017-4-12 19:56:32

np


ben
2017-4-12 19:56:38

question tho — is it generally ok for someone to merge small things like that? or better to wait until after the release (to make less work for you)


ben
2017-4-12 19:56:46

I forget


stamourv
2017-4-12 19:57:02

For small things like that, no need for PRs. You can just push them directly.


stamourv
2017-4-12 19:57:33

You can also include in the commit message something along the lines of “merge to 6.9”, if you want them included in the release.


stamourv
2017-4-12 19:57:42

Then I just cherry-pick them.


stamourv
2017-4-12 19:57:49

This one I just did because it was a no brainer.


stamourv
2017-4-12 19:58:28

In general, after branch day (7th) and before testing (15th), things can still be merged, though we should limit them to small / “obviously correct” changes.


stamourv
2017-4-12 19:58:40

After that, it’s harder, so best to avoid it.


ben
2017-4-12 19:59:34

ok thanks



stamourv
2017-4-12 20:00:10

General description of the process.


ben
2017-4-12 20:23:35

@asumu (or anyone) is there an easy way to print the contracts Typed Racket will make from a type?


ben
2017-4-12 20:23:55

specifically from a require/typed … I think I remember you showing me how to do this


samth
2017-4-12 20:25:38

@ben you probably want value-contract … ?


samth
2017-4-12 20:25:45

or do I misunderstand?


ben
2017-4-12 20:27:51

@samth yeah I tried that, but got #f. http://pasterack.org/pastes/85129


ben
2017-4-12 20:29:45

a hard thing that worked: expand the typed module, copy/paste part of the #%contract-defs submodule


ben
2017-4-12 20:30:29

so I’m now looking into what I can require` from that submodule, but was hoping there was something easier


samth
2017-4-12 20:32:02

I don’t know of more than that to do


ben
2017-4-12 20:32:43

ok. Any idea why value-contract is returning #f?


samth
2017-4-12 20:32:57

no, but I’d try calling it not in the typed module


samth
2017-4-12 20:34:04

maybe because of the contract on value-contract


ben
2017-4-12 20:37:40

ben
2017-4-12 20:38:26

(strange things: just providing f or doing a rename-out instead of define both give #f for the value-contract)


abmclin
2017-4-12 20:43:16

My apologies for asking such basic questions. I’m using the Rackunit library for the first time to perform testing on my new code.

I have test cases which run fine but I can’t figure out how to use correctly run-tests from rackunit/text-ui. According to documentation, it expects to receive a test-case or a test-suite but the test cases I’ve defined with the test-case form executes immediately and evaluate to void. I don’t understand how to create test-cases as values so I can pass them to run-tests.

I understand that test-case is a macro but apparently run-tests or as a matter of fact test-case? predicate are expecting to receive test cases as actual values.

I don’t know what I’m doing wrong and reading the available docs isn’t clearing up my confusion.


abmclin
2017-4-12 20:43:54

Would appreciate if you could point out where I’m going wrong or refer me to examples.


ben
2017-4-12 20:45:26

I don’t know text-ui, but you can use a test submodule: #lang racket (define (plus2 x) (+ 2 x)) (module+ test (require rackunit) (test-case "plus2 works?" (check-equal? (plus2 3) 5))) ;; run `raco test FILE.rkt` to test


leif
2017-4-12 20:46:21

@mflatt I’m looking at GEN_BIN_OP in numbers.c, and I figure that iop is for integer operator, fop is for floating point operator, but I’m not sure what fsop is for.


leif
2017-4-12 20:46:37

This convention seems pretty common, also being used a lot in GEN_UNARY_OP


leif
2017-4-12 20:46:46

Can you tell me what the s stands for here?


leif
2017-4-12 20:47:51

Otherwise I would just guess its for floating point single precision.


mflatt
2017-4-12 20:51:48

@leif you guess correctly; without the “s” is double-precision


abmclin
2017-4-12 20:52:52

@ben thanks, I can use that approach. In my case, I’m keeping the tests separate from the code so in my separate test file, I’d just wrap all of the test cases in module+ test?


ben
2017-4-12 20:53:47

hmm, yeah.. the entire module can look like #lang racket (module+ test (require rackunit) ........... )


abmclin
2017-4-12 20:54:04

I’ll give that a try.


leif
2017-4-12 20:54:42

Okay cool.


leif
2017-4-12 20:55:20

It seems a bit odd to me that the UNARY ops take in values for INF and NAN (an all of the various variants), but the BIN ops don’t.


leif
2017-4-12 20:55:27

@mflatt ^


leif
2017-4-12 20:55:29

Anyway, thanks.


mflatt
2017-4-12 21:00:24

Probably it’s that unary operations have different/simpler shortcuts


leif
2017-4-12 21:01:55

Fair. Thank you.


leif
2017-4-12 21:49:46

Also, thanks to racket, I have now learned that: log(-∞) = ∞+πi


leif
2017-4-12 21:50:00

When log is base e anyway…


leif
2017-4-12 22:43:03

@mflatt Could you comment on this?: https://github.com/racket/racket/pull/1667


leif
2017-4-12 22:43:24

It changes log to accept a second argument as its base.


leif
2017-4-12 22:44:05

If the idea is fine I will document, and add tests.