lelerabi
2020-10-9 13:22:54

@lelerabi has joined the channel


lelerabi
2020-10-9 14:25:15

Hello! Is there a keybinding for DrRacket on Windows to select all the text until the matching parentheses, starting from an open parentheses?


spdegabrielle
2020-10-9 14:32:51

‘Keyboard shortcuts’ in the manual https://docs.racket-lang.org/drracket/Keyboard_Shortcuts.html

Also note > And finally, the authoritative source for keybindings is the Edit menu’s Show Active Keybindings menu item. Keybindings in DrRacket are often sensitive to the window that has the keyboard focus, so the contents of the window that Show Active Keybindings opens will depend where the keyboard focus was when the menu was selected.


spdegabrielle
2020-10-9 14:34:00

lelerabi
2020-10-9 14:41:40

thanks @spdegabrielle


spdegabrielle
2020-10-9 14:58:31

Welcome to the Racket Slack :smiley:


sorawee
2020-10-9 17:33:10

On Mac, it’s shift+alt+right (or shift+alt+left). Could be different on Windows


chansey97
2020-10-9 20:59:43

Hi, I have a question about delimited continuation in Racket. See the following code: reset/shift : (reset (+ 1      (shift k1 (+ 3 (k1 10)))      (shift k2 (k2 100))      1000)) >> 1114 prompt/control : (prompt (+ 1      (control k1 (+ 3 (k1 10))) ; <------ why the `(+ 3 [])` still be evaluated?      (control k2 (k2 100))      1000)) >> 1114 I can understand the reset/shift case, but I can’t understand the prompt/control case.

Why the prompt/control case also returns 1114 instead of 1111. When the (k2 100) returns, why the control flow won’t abort to the prompt? (It seems the (+ 3 []) still be evaluated?) In my understanding, opposite to shift, when control captures a delimited continuation k, there should be no additional prompt embedded in that k, right? Thanks.


rokitna
2020-10-9 21:34:01

Assuming I haven’t messed up somewhere in my understanding of this… In the reset/shift scenario, k2 becomes (lambda (v) (+ 1 10 v 1000)) and the (+ 3 _) happens regardless of the continuation use because the call to k1 set up a reset barrier protecting it. In the prompt/control scenario, the call to k1 doesn’t set up a prompt barrier, but that means k2 captures the (+ 3 _) and becomes (lambda (v) (+ 3 (+ 1 10 v 1000))).


mflatt
2020-10-9 21:35:47

There’s no extra prompt in k1, but the original prompt is still there, so k2 captures (+ 3 (+ 1 10 …))). In other words, the difference is whether k2 captures the (+ 3 •) part or whether the (+ 3 •) part sits outside the part that is captured (but also outside the part that is discarded) for k2.


chansey97
2020-10-9 21:51:10

So the prompt/control , the k2 still capture (+ 3 []), I didn’t realize this before. Thanks @mflatt and @rokitna.


chansey97
2020-10-9 21:52:12

It seems that these two cases return the same result but the behaviors are different.


chansey97
2020-10-9 21:54:39

In the reset/shift case, k2 capture: k2 = (λ (u) (reset (+ 1 10 u 1000))) (+ 3 []) not in k2, because k1 has a reset to protecting: k1 = (λ (v) (reset ;<--- this make `k2` cannot capture `(+ 3 [])` (+ 1 v (control k2 (k2 100)) 1000))) In the prompt/control case, k2 capture: k2 = (λ (u) (+ 3 (+ 1 10 u 1000)))


rokitna
2020-10-9 22:10:38

Oh yeah, k2 does have a reset in it in the first scenario. I forgot that. Your explanation looks good to me.