Re: [racket-users] scribble racketresultblock and racketinput

2016-03-07 Thread Matthew Flatt
At Mon, 7 Mar 2016 18:55:15 -0700, Matthew Flatt wrote:
> (I think the documentation should say that `racketinput` uses the
> 'code-inset style, and I'll fix that.)

On closer inspection, the missing documentation seems to be that
`racketresult` doesn't use the 'code-inset style, while `racketblock`
and `racketinput` do.

In fact, the indentation of `racketresult` is implemented by adding two
spaces to each line, instead of by using `nested` like the other forms.
I don't know why `racketresult` it's different, and it seems like a
mistake (by me). Since ``racketblock0` plus `nested` offers a path to
the missing style, I'll document the current state instead of trying to
clean it up and risk changing existing documents.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] scribble racketresultblock and racketinput

2016-03-07 Thread Matthew Flatt
If you want input and output to be together as an interaction, I
recommend using `examples` (from `scribble/example`) with `eval:alts`
to provide a result manually.

If "the same vertical line" just means "the same style of vertical
line", you could use

 @nested[#:style 'code-inset
 @racketresultblock0[]]

(I think the documentation should say that `racketinput` uses the
'code-inset style, and I'll fix that.)


At Mon, 7 Mar 2016 20:26:03 -0500, Neil Van Dyke wrote:
> In Scribble, how does one use `racketresultblock` in combination with 
> `racketinput`, such that the result expression is formatted with the 
> same vertical line that the input expression has?
> 
> (I know how to do this with `racketresult`, but not for multi-line results.)
> 
> Neil V.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] scribble racketresultblock and racketinput

2016-03-07 Thread Neil Van Dyke
In Scribble, how does one use `racketresultblock` in combination with 
`racketinput`, such that the result expression is formatted with the 
same vertical line that the input expression has?


(I know how to do this with `racketresult`, but not for multi-line results.)

Neil V.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Dumb lexical scope question

2016-03-07 Thread brendan
Ah, of course, I forgot all about that. I read that paper a while back but I 
never felt that I really "got" it; it was easy to see the problems that were 
being solved, but hard to see that the given solutions were correct. I'll have 
to go through it again now that I've used the system a little more. Anyway, 
thank you Dr. Flatt and Dr. Felleisen for the help (and for Racket).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: custom keybindings (AltGr)

2016-03-07 Thread Bert De Ketelaere
Hello,


after looking around trying to fix my previous 
problem 
I found that DrRacket really is not sending any event for AltGr+(Key x) 
combinations if this combination doesn't actually produces a char.

I tried changing the win32/key.rkt file in gui-lib so DrRacket would get these 
events and en passant I tried to make DrRacket behave more like other Win 
programs when it comes to keyboard input.


my attempt is at:

https://github.com/bdeket/gui/commit/994a5655a9f913b7388e0c74c1b6203659b645d3


A few problems remain:

Ctrl+Alt+(key x): where this combination doesn't produce a char, x is produced 
instead of nothing

Ctrl+Alt+(key x) or AltGr+(key x): the release event is now hijacked and sends 
another keypress-event.

This is a problem, but I don't know how to fix this, and I prefer this over 
the previous state where key-events where ignored


Unfortunately I didn't understand all the code that was already there, and I 
didn't find standard tests to test this.

Are there tests for the key-events?


Kind regards,

Bert

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Dumb lexical scope question

2016-03-07 Thread Matthew Flatt
At Mon, 7 Mar 2016 03:52:39 -0800 (PST), brendan wrote:
> I'm sure I'm missing something obvious here. In the Guide, introducing syntax 
> objects, it says:
> 
> "Most notably, free-identifier=? determines whether two identifiers refer to 
> the same binding:
> 
> ...
> 
> (free-identifier=? #'car (let ([car 8])
>  #'car))
> 
> The last example above, in particular, illustrates how syntax objects 
> preserve 
> lexical-context information."
> 
> To me it looks suspiciously like those two identifiers refer to different 
> bindings.

Yep, that example is broken with the new (as of v6.3) macro system.

If we use the longhand form `(quote-syntax  #:local)`, then the
example works as intended:

 > (free-identifier=? #'car (let ([car 8])
  (quote-syntax car #:local)))
 #f

The problem is that #' prunes some scopes to make it better with
certain macro patterns. That scope pruning works well in a macro
implementation, but it's not so great for examples outside of a macro
implementation that are intended to probe bindings.

For more information on why #' prunes some scopes, see

http://www.cs.utah.edu/plt/scope-sets/general-macros.html#%28part._.Local_.Bindings_and_.Syntax_.Quoting%29


I'll fix the broken example in the docs.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Dumb lexical scope question

2016-03-07 Thread Matthias Felleisen

You are evaluating 

 (let ((car 8)) #’car) 
!=
 (let ((car 8)) car) 

The first one returns a piece of syntax, the second one the value 8. 


> On Mar 7, 2016, at 8:43 AM, brendan  wrote:
> 
> I've realized that technically speaking my post did not actually ask a 
> question, so: Why does the expression in the example above evaluate to true? 
> After all, "car" evaluates to "#" whereas "(let ([car 8]) 
> car)" evaluates to "8". It sure seems like the two identifiers have different 
> bindings.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Dumb lexical scope question

2016-03-07 Thread brendan
I've realized that technically speaking my post did not actually ask a 
question, so: Why does the expression in the example above evaluate to true? 
After all, "car" evaluates to "#" whereas "(let ([car 8]) car)" 
evaluates to "8". It sure seems like the two identifiers have different 
bindings.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Dumb lexical scope question

2016-03-07 Thread brendan
I'm sure I'm missing something obvious here. In the Guide, introducing syntax 
objects, it says:

"Most notably, free-identifier=? determines whether two identifiers refer to 
the same binding:

...

(free-identifier=? #'car (let ([car 8])
 #'car))

The last example above, in particular, illustrates how syntax objects preserve 
lexical-context information."

To me it looks suspiciously like those two identifiers refer to different 
bindings.

You think you're starting to get this macro stuff, and then...

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.