chansey97
2020-8-2 09:39:51

Can define-values be used in internal definitions? For example: (define (test) (define-values (x y z) (values 1 2 3)) ) >> begin (possibly implicit): no expression after a sequence of internal definitions in: (begin (define-values (x y z) (values 1 2 3))) But it works in top level definition.


sorawee
2020-8-2 09:44:33

Yes, it can be used in internal definitions. The problem here is exactly what the error message says: the function must return value(s).


sorawee
2020-8-2 09:45:21

(define (test) (define-values (x y z) (values 1 2 3)) #f)


chansey97
2020-8-2 09:45:21

@sorawee I understand, thanks!


ego
2020-8-2 10:47:15

I like the mission control binding though… I’d really like the plain up-arrow to do this, as it does in racket cli

how are custom keybindings defined?


ego
2020-8-2 10:52:02

I can’t see the difference, what am I missing? https://docs.racket-lang.org/style/Textual_Matters.html



soegaard2
2020-8-2 10:57:13

Turns out Scribble fixes the bad example.


notjack
2020-8-2 11:14:00

“Task failed successfully”



sorawee
2020-8-2 11:18:35

It’s been fixed for a while, but the fix hasn’t made to the release doc (it should within a week?)


ego
2020-8-2 13:27:12

no worries, I guessed these were both the ‘good’ form :)


ego
2020-8-2 13:28:55

just want to say this slack is great, everyone is so helpful



spdegabrielle
2020-8-2 14:48:37

But I’m not sure that will be sufficient to cover changing the keybinding for arrow keys.


wanpeebaw
2020-8-2 18:35:23

I found there is a count function can count element by comparing multiple lists. (count equal? list-a list-b) But it seems that I can’t do the same thing with sequence-count on multiple sequences. Also can’t do the same with stream-count.

Is there any suggestion?


sorawee
2020-8-2 20:08:05

(define xs (list 1 2 3)) (define ys (list 1 -2 3)) (sequence-count equal? (in-parallel xs ys))


sorawee
2020-8-2 20:09:40

(define xs (stream 1 2 3)) (define ys (stream 1 -2 3)) (stream-count equal? (sequence->stream (in-parallel xs ys)))


ego
2020-8-2 20:53:07

packaging question… I have seen a few packages which have a single main.rkt with (provides ...) from various private modules for the public interface of the package is main.rkt a privileged filename like info.rkt? or a package will expose the provided names from any files in the top-level dir? …or something else?


sorawee
2020-8-2 20:55:39

Yep. (require abc) will search abc/main.rkt


ego
2020-8-2 21:33:19

only main.rkt? so every package should have a main.rkt ?


sorawee
2020-8-2 21:37:31

I mean, technically you can ask people to always write (require abc/def), and this will look for abc/def.rkt, so strictly speaking, no.


sorawee
2020-8-2 21:38:19

But usually, it’s easier to write (require abc), so most library packages will have main.rkt


sorawee
2020-8-2 21:38:39

There’s also tool packages for DrRacket, and those will have tools.rkt instead of main.rkt


ego
2020-8-2 21:48:00

perfect, thanks