
yes, you do need to worry about it

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

which means you have to rename to make that true

@jerryj You also might find this useful: https://github.com/racket/racket/blob/master/racket/src/racket/mk-gdbinit.rkt

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

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:

He, he. Which GC were you using?

cgc

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

@stamourv thanks for merging #1665

np

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)

I forget

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

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.

Then I just cherry-pick them.

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

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.

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

ok thanks


General description of the process.

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

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

@ben you probably want value-contract
… ?

or do I misunderstand?


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

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

I don’t know of more than that to do

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

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

maybe because of the contract on value-contract


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

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.

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

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

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

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

Can you tell me what the s
stands for here?

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

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

@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?

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

I’ll give that a try.

Okay cool.

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.

@mflatt ^

Anyway, thanks.

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

Fair. Thank you.

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

When log
is base e
anyway…

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

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

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