slack1
2017-11-28 22:44:41

Is the vector basically what I’m thinking of reaching for when I’m looking for a multidimensional array?


slack1
2017-11-28 22:52:29

It seems to have awkward access syntax


samth
2017-11-28 22:53:53

@slack1 vectors are one dimensional arrays


samth
2017-11-28 22:54:05

the math/array library has multi-dimensional arrays


slack1
2017-11-28 22:57:04

Oh I see, I’m surprised it would be tucked there and not somewhere more general



slack1
2017-11-29 01:12:29

Is the best way to do an immediately-invoked procedure just to wrap a lambda with more parens?


lexi.lambda
2017-11-29 01:21:22

Why would you want an immediately-invoked procedure?


slack1
2017-11-29 01:24:34

I wanted to use a lambda right away for its results


slack1
2017-11-29 01:29:00

I suppose that’s a code smell and I should just define the function somewhere else?


lexi.lambda
2017-11-29 01:29:31

I just don’t understand why you would wrap your code in a lambda if you wanted to evaluate it immediately.


lexi.lambda
2017-11-29 01:29:53

That is, if you had ((lambda () (+ 1 2))), why wouldn’t you just write (+ 1 2), instead?


slack1
2017-11-29 01:30:47

What if you wanted a lambda that takes an input?


lexi.lambda
2017-11-29 01:31:08

Then you should probably use let or an internal define.


lexi.lambda
2017-11-29 01:31:45

That is, instead of ((lambda (x) (+ x 2)) 3), write (let ([x 3]) (+ x 2)).


slack1
2017-11-29 01:31:55

ah that is clearer


slack1
2017-11-29 01:32:05

that almost makes let look like lambda too


lexi.lambda
2017-11-29 01:32:25

Indeed, you can implement let as a macro in terms of lambda.


lexi.lambda
2017-11-29 01:32:49

Many blocks also accept internal definitions, so you could write (let () (define x 3) (+ x 2)) instead.


slack1
2017-11-29 01:34:49

thanks!


cfinegan
2017-11-29 04:00:41

Is there a way to get non-buffered keyboard input from a console window in racket? I basically want behavior identical to get-key-press from graphics/graphics (https://docs.racket-lang.org/graphics/Keyboard_Operations.html#%28def._%28%28lib._graphics%2Fgraphics..rkt%29._get-key-press%29%29), but without the viewport. I.e., the console window should block and wait for the next keypress it detects.


notjack
2017-11-29 04:20:11

@samth I think this PR got missed in the 6.11 release: https://github.com/racket/main-distribution/pull/1


notjack
2017-11-29 04:21:44

nothing’s broken, but I think the rackunit-typed package now isn’t locked to release catalogs. Or maybe it is? I’m not sure how the main-distribution package interacts with transitive dependencies


dustin
2017-11-29 05:06:50