[racket-users] Proper handling for a custom current-read-interaction?

2016-06-06 Thread Alexis King
I am trying to write a custom current-read-interaction for a language
with non-s-expression syntax, and I’m not sure I completely understand
the protocol for how to detect the end of input across both the command
line and DrRacket. I first wrote an implementation for DrRacket, which
appears to continually call current-read-interaction until it returns
#, at which point it presents the user a new prompt. Therefore, I
simply decided to check char-available? on the provided port and return
# whenever the port returned #f. This seems to work fine in
DrRacket.

On the other hand, I found it does not work at all on the command line.
Returning # on the command line just seems to kill the entire REPL.
Furthermore, unlike DrRacket, the CLI does not seem to produce an EOF at
the end of each expression, just a newline, re-using the same port each
time. Checking for a newline in DrRacket would not work at all, though,
because DrRacket permits entering multiline expressions in its REPL.

This would lead me to believe that there are two completely different
protocols for how the two different REPLs work:

  1. In DrRacket, read all the contents in the port provided to
 current-read-interaction. Check the port against char-available?
 each call, and return # when it returns #f.

  2. At the command line, read all contents up until a newline. Check
 the port against peek-char each call, and return # when it
 returns # to support exiting the REPL by sending ^D.

These seem totally different, frustratingly so, since it seems like it
would not be too hard for the CLI to use the same behavior as DrRacket.
My guess is that I’m overcomplicating things at least a little, but I
wasn’t able to locate anything about what exactly is expected of the
function provided to current-read-interaction. Is there a way to
implement it that can gracefully handle both scenarios? If not, what is
the proper way to check if code is running in the CLI REPL or the
DrRacket REPL and adjust behavior accordingly?

Alexis

-- 
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] Detecting mouse events on top of picts?

2016-06-06 Thread George Neuner

On 6/6/2016 8:36 PM, David Christiansen wrote:

> That seems overly complicated.  Can you not just compare the mouse's
> coordinates to the picture's location in the canvas?

I don't have a good way to know where the picture itself is - only its
bounding box. So if the picture consists of a doughnut shape, I want
the center of the doughnut and the region around its edge to not count
as clicks on it.


Understood.  Is it possible to define a region to represent the 
clickable areas?  This is the way I would do it if possible.


I haven't done much GUI programming in Racket, so I don't know exactly 
what it can do, but in, e.g., Windows GDI you can create a region 
directly from a binary (1-bit depth) bitmap [and a bitmap of any depth 
can be converted to a binary bitmap].  Set (1) pixels in the bitmap will 
be included in the region and unset (0) pixels will be excluded.


A region can directly answer whether a point (mouse coordinate) is 
inside it or not.


George

--
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] Constructor-style printing for sets?

2016-06-06 Thread Alex Knauth
If I run this program:

#lang racket
(set 1 2 3)

It prints out the value:

(set 1 2 3)

That's wonderful! It uses nice constructor-style printing, just like I wanted. 
That was without changing the printing settings from the default print mode.

However, if I change DrRacket's printing settings to use constructor-style 
printing instead, I get this:

(immutable-custom-set ...)

The constructor-style printing mode in DrRacket uses `print-convert` from 
`mzlib/pconvert` to do this, and the `racket/set` library already uses 
`gen:custom-write` for constructor-style printing.

Should `racket/set` sets also use a property similar to `prop:print-converter` 
that `print-convert` can recognize and use? Or should sets be another case in 
the implementation of `print-convert`?

Alex Knauth

-- 
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] Detecting mouse events on top of picts?

2016-06-06 Thread Matthias Felleisen

Why don’t you check the location of the mouse movement? The coordinates are 
close enough. 



> On Jun 6, 2016, at 4:45 PM, David Raymond Christiansen 
>  wrote:
> 
> Hi all,
> 
> I'm looking for a way to check whether a mouse pointer is on top of a 
> particular pict that has been drawn to a canvas%.
> 
> Right now, the best I've been able to do is to render the pict to two 
> off-screen bitmaps with different background colors, and then check whether 
> or not the pixel on each bitmap that corresponds to the mouse location in the 
> canvas is the same as the bitmap's background color.
> 
> I use two bitmaps in case a region drawn by the pict is the same color as the 
> background that I have chosen. Given that there's support for the dc pict, 
> which uses arbitrary imperative commands for drawing, I doubt that I can do 
> better than this, but I'd appreciate hearing any techniques that I'm missing.
> 
> This is being used to implement something similar to the clickback feature in 
> Slideshow, but for GUI windows, and with arbitrarily nested clickbacks.
> 
> Thanks!
> 
> /David
> 
> -- 
> 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.


Re: [racket-users] Detecting mouse events on top of picts?

2016-06-06 Thread David Christiansen
> That seems overly complicated.  Can you not just compare the mouse's
> coordinates to the picture's location in the canvas?

I don't have a good way to know where the picture itself is - only its
bounding box. So if the picture consists of a doughnut shape, I want
the center of the doughnut and the region around its edge to not count
as clicks on it.

My first go at this was actually built on an image combinator library
where each image also could report on which pixels within its bounding
box were occluded, but I'd much rather re-use all the great things in
pict than develop my own.

So I use the location on the canvas and the size of the bounding boxes
to determine which pictures to actually check, and then the drawing
test to see if the mouse is actually over them.

-- 
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] Detecting mouse events on top of picts?

2016-06-06 Thread David Christiansen
> If I understand the goal, you could render to one bitmap that has an
> alpha channel, and then check whether the pixel under the mouse ends up
> with a non-zero alpha.

That's a good simplification. Thanks!

I had kind of been hoping that there was an alternative approach that
I was missing, but this at least will save one drawing.

/David

-- 
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] Detecting mouse events on top of picts?

2016-06-06 Thread George Neuner


On 6/6/2016 4:45 PM, David Raymond Christiansen wrote:
I'm looking for a way to check whether a mouse pointer is on top of a 
particular pict that has been drawn to a canvas%.


Right now, the best I've been able to do is to render the pict to two 
off-screen bitmaps with different background colors, and then check 
whether or not the pixel on each bitmap that corresponds to the mouse 
location in the canvas is the same as the bitmap's background color.


That seems overly complicated.  Can you not just compare the mouse's 
coordinates to the picture's location in the canvas?  Particularly if 
you expect the user to click somewhere, you can just handle mouse events 
sent to the canvas.


George

--
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] Detecting mouse events on top of picts?

2016-06-06 Thread Matthew Flatt
At Mon, 6 Jun 2016 16:45:33 -0400, David Raymond Christiansen wrote:
> I'm looking for a way to check whether a mouse pointer is on top of a 
> particular pict that has been drawn to a canvas%.
> 
> Right now, the best I've been able to do is to render the pict to two 
> off-screen bitmaps with different background colors, and then check 
> whether or not the pixel on each bitmap that corresponds to the mouse 
> location in the canvas is the same as the bitmap's background color.
>
> I use two bitmaps in case a region drawn by the pict is the same color 
> as the background that I have chosen. Given that there's support for the 
> dc pict, which uses arbitrary imperative commands for drawing, I doubt 
> that I can do better than this, but I'd appreciate hearing any 
> techniques that I'm missing.

If I understand the goal, you could render to one bitmap that has an
alpha channel, and then check whether the pixel under the mouse ends up
with a non-zero alpha.

-- 
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] ultimate performance tuning

2016-06-06 Thread 'John Clements' via Racket Users
Having trouble making the most use of your machine during Racket setup tasks? 
Try specifying a non-integer number of CPUs!

clements@desmond:~/git-clements/pkgs/jbc-utils$ raco setup -j 6.972 shelly  

 
raco setup: version: 6.4
raco setup: platform: x86_64-linux [3m]
raco setup: installation name: 6.4
raco setup: variants: 3m
raco setup: main collects: /usr/racket/collects
raco setup: collects paths: 
raco setup:   /home/clements/.racket/6.4/collects
raco setup:   /usr/racket/collects
raco setup: main pkgs: /usr/racket/share/pkgs
raco setup: pkgs paths: 
raco setup:   /usr/racket/share/pkgs
raco setup:   /home/clements/.racket/6.4/pkgs
raco setup: links files: 
raco setup:   /usr/racket/share/links.rktd
raco setup:   /home/clements/.racket/6.4/links.rktd
raco setup: main docs: /usr/racket/doc
raco setup: --- updating info-domain tables ---
raco setup: --- pre-installing collections ---
raco setup: --- installing foreign libraries ---
raco setup: --- installing shared files ---
raco setup: --- compiling collections ---
raco setup: --- parallel build using 6.972 jobs ---
raco setup: 6 making: /jbc-utils/shelly
raco setup: --- creating launchers ---
raco setup: --- installing man pages ---
raco setup: --- building documentation ---
raco setup: --- installing collections ---
raco setup: --- post-installing collections ---



-- 
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] Detecting mouse events on top of picts?

2016-06-06 Thread David Raymond Christiansen

Hi all,

I'm looking for a way to check whether a mouse pointer is on top of a 
particular pict that has been drawn to a canvas%.


Right now, the best I've been able to do is to render the pict to two 
off-screen bitmaps with different background colors, and then check 
whether or not the pixel on each bitmap that corresponds to the mouse 
location in the canvas is the same as the bitmap's background color.


I use two bitmaps in case a region drawn by the pict is the same color 
as the background that I have chosen. Given that there's support for the 
dc pict, which uses arbitrary imperative commands for drawing, I doubt 
that I can do better than this, but I'd appreciate hearing any 
techniques that I'm missing.


This is being used to implement something similar to the clickback 
feature in Slideshow, but for GUI windows, and with arbitrarily nested 
clickbacks.


Thanks!

/David

--
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] Strange Loop registration

2016-06-06 Thread Vincent St-Amour
Thanks John! We've fixed the front page.

RacketCon registration is now open at (linked from the RacketCon page):
https://www.eventbrite.com/e/racketcon-2016-tickets-24349152972

We're very excited to announce that Emina Torlak will be giving the
keynote this year, on Synthesis and Verification for All.

We still have room in the schedule for more speakers. If you're
interested, just let me know!

See you in St. Louis!

Vincent



On Mon, 06 Jun 2016 14:53:51 -0500,
'John Clements' via Racket Users wrote:
> 
> Strange Loop Registration is opening this Wednesday at Noon, and as I found 
> out to my chagrin last year, those tickets do sell out *extremely* quickly.  
> I see that the page for RacketCon is up, but I don’t think I’ve seen notice 
> of it on the users mailing list, and it also looks to me like the main page 
> (https://www.racket-lang.org/) implicitly suggests that it’s not happening, 
> since there’s no announcement in the “news” section and the list of prior 
> years doesn’t include 2015.
> 
> Anyhow: if you’re planning to attend RacketCon 2016, and it’s going to be 
> co-located with Strange Loop, now’s the time to think about registering for 
> Strange Loop.
> 
> Hope to see you there this year!
> 
> John
> 
> -- 
> 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] Strange Loop registration

2016-06-06 Thread 'John Clements' via Racket Users
Strange Loop Registration is opening this Wednesday at Noon, and as I found out 
to my chagrin last year, those tickets do sell out *extremely* quickly.  I see 
that the page for RacketCon is up, but I don’t think I’ve seen notice of it on 
the users mailing list, and it also looks to me like the main page 
(https://www.racket-lang.org/) implicitly suggests that it’s not happening, 
since there’s no announcement in the “news” section and the list of prior years 
doesn’t include 2015.

Anyhow: if you’re planning to attend RacketCon 2016, and it’s going to be 
co-located with Strange Loop, now’s the time to think about registering for 
Strange Loop.

Hope to see you there this year!

John

-- 
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] Flat Contract Value Generator

2016-06-06 Thread Matthias Felleisen

> On Jun 6, 2016, at 1:19 PM, Matthew Butterick  wrote:
> 
> 
> On Jun 5, 2016, at 1:33 PM, Matthias Felleisen  wrote:
> 
>> when I taught a Sw Dev course and the students voted to use JSON as the data 
>> exchange language. 
> 
> I always thought the reason you wisely prefer to keep politics out of 
> programming was to avoid outcomes like this ;)


On occasion, you need to demonstrate to students that elections matter because 
they have consequences. It worked like a charm :-) 

-- 
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] define-serializable-cstruct with versions?

2016-06-06 Thread Matthew Flatt
Yes, but I think a different protocol will be needed than for
`serializable-struct`.

With

 (serializable-struct pond (depth))

it's clear that the deserializer receives a single value for the single
field (or, more generally, N values for N fields). So, it's clear how
to make a compatibility deserialization function:

 (serializable-struct/versions pond 1 (num-fish depth)
   ([0 (lambda (d) (pond 0 d))
   (lambda () )]))

With 

  (define-serializable-cstruct _pond ([depth _float]))

the deserializer internally deals with a byte-string representation of
non-pointer content plus a structured representation of pointer
content. We probably don't want to expose those details, and you don't
want to deal with them.

An alternative it to make the compatibility protocol work in terms of a
separate cstruct declaration:

 (define-serializable-cstruct _old-pond ([depth _float]))

 (define-serializable-cstruct _pond ([num-fish _int]
 [depth _float])
   #:version 1
   #:other-versions ([0 deserialize-chain:cstruct:old-pond
(lambda (op)
  (make-pond 0 (old-pond-depth op)))
(lambda () )]))

That is, compatibility deserialization is based on a reference to
deserialization information for a cstruct that has the same shape as
the old version, plus converters from instances of the old shape to the
new cstruct.

Does that interface seem ok?


At Sun, 5 Jun 2016 22:04:23 +0200, Berthold Bäuml wrote:
> Would it be possible to add for the serializable cstruct 
> (define-serializable-cstruct) versioning like in 
> define-serializable-struct/versions?
> 
> Berthold
> 
> -- 
> ---
> Berthold Bäuml -- Head of Autonomous Learning Robots Lab
> DLR, Robotics and Mechatronics Center (RMC)
> Münchner Str. 20, D-82234 Wessling
> Phone +49 8153 282489
> http://www.robotic.de/Berthold.Baeuml
> 
> -- 
> 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.


Re: [racket-users] Flat Contract Value Generator

2016-06-06 Thread Matthew Butterick

On Jun 5, 2016, at 1:33 PM, Matthias Felleisen  wrote:

> when I taught a Sw Dev course and the students voted to use JSON as the data 
> exchange language. 

I always thought the reason you wisely prefer to keep politics out of 
programming was to avoid outcomes like this ;)

-- 
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: I can't open my previous file

2016-06-06 Thread 'John Clements' via Racket Users

> On Jun 6, 2016, at 8:45 AM, George Neuner  wrote:
> 
> On Mon, 6 Jun 2016 13:34:41 +0100, Laurent
>  wrote:
> 
>> Ah, so you meant MrEd Designer (MED) then, I wasn't sure :)
>> (mred was the previous GUI lib, part of DrScheme, whereas MED is an
>> external package)
> 
> Sorry for the confusion - I wasn't aware that the design editor went
> by a different acronym.  I assumed MrEd the library and MrEd the
> editor were complementary.
> 
> I know - never  ASS U ME.
> 
>> Actually, it doesn't look like it was created by MED to me, at least not my
>> versions (3.x), which generate only text files anyway (I think the previous
>> versions were doing that too). MED files have a specific commented header
>> too.
> 
> I used it a long time ago - back in PLT Scheme days.  My [maybe
> faulty] recollection is that "resources" created by the design editor
> looked a lot like Zhang's file. 

In case it matters: DrRacket stores its files as text when they contain only 
textual data, but when they contain non-textual data, e.g. pictures or 
graphical block comments, they’re stored in this format instead. To see this, 
try creating a file in DrRacket and then inserting a graphical comment box 
(Insert > Insert Comment Box), then save the file and examine it using another 
text editor.

Apologies if you already knew all of this.

Best,

John Clements



-- 
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] I can't open my previous file

2016-06-06 Thread Matthew Flatt
Based on Robby's work tracking down the problem, I've pushed a repair
for the next snapshot build. (I'm surprised that this bug escaped
detection before.)

Since the problem was in file reading, the next snapshot build will
include a repaired DrRacket that is able to read your original file.

Thank you for the report, and apologies again for the trouble.

Matthew

At Mon, 6 Jun 2016 07:33:54 -0500, Robby Findler wrote:
> I'm not sure what happened, but there seems to be a bug in the way
> DrRacket reads files somehow. I've not figured out exactly what that
> is (but it appears to be somewhere in the get-a-string method in the
> editor-stream-in% class).
> 
> Meanwhile, I'm attaching a recovered version of the file. The only
> difference should be some chinese characters that followed "object
> ..." on line 52 of the recovered file are now gone.
> 
> I'm sorry for the trouble this has caused.
> 
> Robby
> 
> -- 
> 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: I can't open my previous file

2016-06-06 Thread George Neuner
On Mon, 6 Jun 2016 13:34:41 +0100, Laurent
 wrote:

>Ah, so you meant MrEd Designer (MED) then, I wasn't sure :)
>(mred was the previous GUI lib, part of DrScheme, whereas MED is an
>external package)

Sorry for the confusion - I wasn't aware that the design editor went
by a different acronym.  I assumed MrEd the library and MrEd the
editor were complementary.

I know - never  ASS U ME.

>Actually, it doesn't look like it was created by MED to me, at least not my
>versions (3.x), which generate only text files anyway (I think the previous
>versions were doing that too). MED files have a specific commented header
>too.

I used it a long time ago - back in PLT Scheme days.  My [maybe
faulty] recollection is that "resources" created by the design editor
looked a lot like Zhang's file. 

Anyway, I'm glad Robby was able to solve the problem.
George

-- 
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] trying to use dump-memory-stats

2016-06-06 Thread Matthew Flatt
The GC's printer for `dump-memory-stats` is broken on Windows. It
breaks in different ways depending on the compiler used to build Racket
and for 32-bit vs. 64-bit.

I've pushed a repair for the next snapshot build --- at least for the
Utah snapshot, which uses MSVC. I'll probably have to investigate more
to make sure the release and the Northwestern snapshot build work.

At Thu, 2 Jun 2016 05:24:42 -0700 (PDT), Alex Harsanyi wrote:
> I'm trying to use dump-memory-stats to find out where my application uses its 
> memory, unfortunately, it does not seem to print out any usefull info.  When 
> calling it with no arguments I get the value "???64d" for everything:
> 
> Begin Dump
> Begin Racket3m
> :???64d???64d
>  :???64d???64d
>  :???64d???64d
>   :???64d???64d
>   :???64d???64d
>:???64d???64d
>  :???64d???64d
> :???64d???64d
>  :???64d???64d
>:???64d???64d
> ... and so on.
> 
> I'm using Racket 6.5 64bit on a Windows platform.
> 
> Does anyone know how is this supposed to work?
> 
> Thanks,
> Alex.
> 
> -- 
> 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] Potential small bugs on SEwPR

2016-06-06 Thread lfacchi2
1. On Section 14.4, The CK Machine, on page 243, there is a reference to
   /part I(6.4)/, mentioning the specification for the CK Machine: "Comparing
   the Redex specification with the specification in part I(6.4)".

   But I believe /part I(6.4)/ is about the CEK Machine. The CK Machine is the
   subject of /part I(6.3)/.

2. On Section 18.4, Rewriting Calls to Meta-functions, on page 290, it says "In
   part I, we use the notation `M{X := V}' to express the substitution of all 
free
   occurrences of `X' in `M' with `V'."

   But I believe the notation in part I was `M[X ← V]'.

   Also, on the last paragraph of the section, it says "Without this empty
   string, Redex would insert a gap between the `[' and the `M' in the final
   output. I believe this is referring to the `M[X ← V]' notation, and not the
   `M{X := V}' notation.

Finally, I'd like to take the opportunity to ask a question:

The book says that, by default, Redex typesets meta-functions in
small-caps. But, on my tests, running the latest version of Redex, I see
proportional sans-serif instead.

Has this changed since the book was published, or am I doing something wrong? Is
there a way to restore the old behavior without having to add a compound
rewriter for each meta-function?

Thanks a lot for SEwPR and Redex. I finished reading it this weekend and loved
it!

Best.

-- 
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] I can't open my previous file

2016-06-06 Thread 张可星
在 2016年6月6日星期一 UTC+8下午8:34:00,Robby Findler写道:
> I'm not sure what happened, but there seems to be a bug in the way
> DrRacket reads files somehow. I've not figured out exactly what that
> is (but it appears to be somewhere in the get-a-string method in the
> editor-stream-in% class).
> 
> Meanwhile, I'm attaching a recovered version of the file. The only
> difference should be some chinese characters that followed "object
> ..." on line 52 of the recovered file are now gone.
> 
> I'm sorry for the trouble this has caused.
> 
> Robby

OK ,it works ,very thanks

-- 
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] I can't open my previous file

2016-06-06 Thread Laurent
Ah, so you meant MrEd Designer (MED) then, I wasn't sure :)
(mred was the previous GUI lib, part of DrScheme, whereas MED is an
external package)

Actually, it doesn't look like it was created by MED to me, at least not my
versions (3.x), which generate only text files anyway (I think the previous
versions were doing that too). MED files have a specific commented header
too.

In the middle of the file, I can see that on line 317 there is a "#lang
racket", which is not a good sign I believe.

On lines 62 and 221, there is a reference to "Source Code Pro for
Powerline", which seems to be for special fonts, in case that may be
relevant. Does the file try to embed fonts?


On Mon, Jun 6, 2016 at 12:16 PM, George Neuner  wrote:

>
> I just realized that you are the author (or at least maintainer) of
> MrEd-Designer ... so you would know if that file was created by it.
> :-)
>
> George
>
>

-- 
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] I can't open my previous file

2016-06-06 Thread Robby Findler
I'm not sure what happened, but there seems to be a bug in the way
DrRacket reads files somehow. I've not figured out exactly what that
is (but it appears to be somewhere in the get-a-string method in the
editor-stream-in% class).

Meanwhile, I'm attaching a recovered version of the file. The only
difference should be some chinese characters that followed "object
..." on line 52 of the recovered file are now gone.

I'm sorry for the trouble this has caused.

Robby

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


TheGame2.rkt
Description: Binary data


Re: [racket-users] I can't open my previous file

2016-06-06 Thread George Neuner


I just realized that you are the author (or at least maintainer) of 
MrEd-Designer ... so you would know if that file was created by it.

:-)

George

--
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] I can't open my previous file

2016-06-06 Thread George Neuner

On 6/6/2016 6:29 AM, Laurent wrote:

Although the file says:
"Open this file in DrRacket version 6.5 or later to read it."

So it doesn't look like it requires an old version of Racket. (not 
really helping, sorry)


Yes, I was focused on other contents.  But even if the file was created 
by 6.5, it may have been created by a different installation ... one 
that maybe has MrEd?  [It's been a long time since I played with MrEd, 
but that file looks suspiciously like my recollection of a "resource" file].


Is there another GUI builder that might have created it?


On Mon, Jun 6, 2016 at 9:00 AM, George Neuner > wrote:


On 6/6/2016 3:27 AM, 张可星 wrote:

I don't have MrEd installed, too.I think it is vim


Did you have MrEd installed previously in another version of
Racket?  I think you mentioned that this was an old file you were
trying to open.

Your file is in a custom format defined by (lib"read.ss""wxme").
"wxme" is part of Racket  [hopefully unchanged from previous
versions], but I think you may need that "read.ss" file from the
original project to load this file properly.



George

--
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] I can't open my previous file

2016-06-06 Thread Laurent
Although the file says:
"Open this file in DrRacket version 6.5 or later to read it."

So it doesn't look like it requires an old version of Racket. (not really
helping, sorry)

On Mon, Jun 6, 2016 at 9:00 AM, George Neuner  wrote:

> On 6/6/2016 3:27 AM, 张可星 wrote:
>
>> I don't have MrEd installed, too.I think it is vim
>>
>>
> Did you have MrEd installed previously in another version of Racket?  I
> think you mentioned that this was an old file you were trying to open.
>
> Your file is in a custom format defined by (lib"read.ss""wxme"). "wxme" is
> part of Racket  [hopefully unchanged from previous versions], but I think
> you may need that "read.ss" file from the original project to load this
> file properly.
>
> George
>
>
> --
> 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.


Re: [racket-users] I can't open my previous file

2016-06-06 Thread George Neuner

On 6/6/2016 3:27 AM, 张可星 wrote:

I don't have MrEd installed, too.I think it is vim



Did you have MrEd installed previously in another version of Racket?  I 
think you mentioned that this was an old file you were trying to open.


Your file is in a custom format defined by (lib"read.ss""wxme"). "wxme" 
is part of Racket  [hopefully unchanged from previous versions], but I 
think you may need that "read.ss" file from the original project to load 
this file properly.


George

--
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] I can't open my previous file

2016-06-06 Thread 张可星
I don't have MrEd installed, too.I think it is vim

-- 
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] I can't open my previous file

2016-06-06 Thread George Neuner

On 6/6/2016 2:51 AM, 张可星 wrote:

在 2016年6月6日星期一 UTC+8下午2:45:34,gneuner2写道:
> On 6/6/2016 2:32 AM, 张可星 wrote:
> > > Open the file with a text editor and insert a blank line at the
> > > beginning.  Then DrRacket will open it.  I haven't seen this particular
> > > issue previously, but obviously DrRacket is failing to parse the first 
line.
> > >
> > > George
> >
> > obviously DrRacket is failing to parse the first line.yes ,it doesn't help 
.But still thanks
> >
>
> Does that mean you still can't open the file?  Inserting a blank line
> with another editor worked for me.

I can open that file now with a blank line inserted .But it is not what I want.
Drracket parse the file as plain text ,there should have some pictures the the 
code



I just noticed that the file appears to have been created by MrEd. Can 
MrEd open it?  [I don't have it installed to try here.]  I can see where 
there are image binaries included in the file ... they just don't show 
as images in DrRacket.


George

--
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] I can't open my previous file

2016-06-06 Thread 张可星
在 2016年6月6日星期一 UTC+8下午2:45:34,gneuner2写道:
> On 6/6/2016 2:32 AM, 张可星 wrote:
> > > Open the file with a text editor and insert a blank line at the
> > > beginning.  Then DrRacket will open it.  I haven't seen this particular
> > > issue previously, but obviously DrRacket is failing to parse the first 
> > > line.
> > >
> > > George
> >
> > obviously DrRacket is failing to parse the first line.yes ,it doesn't help 
> > .But still thanks
> >
> 
> Does that mean you still can't open the file?  Inserting a blank line 
> with another editor worked for me.
> 
> George

I can open that file now with a blank line inserted .But it is not what I want.
Drracket parse the file as plain text ,there should have some pictures the the 
code

-- 
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] I can't open my previous file

2016-06-06 Thread George Neuner


On 6/6/2016 2:32 AM, 张可星 wrote:

> Open the file with a text editor and insert a blank line at the
> beginning.  Then DrRacket will open it.  I haven't seen this particular
> issue previously, but obviously DrRacket is failing to parse the first line.
>
> George

obviously DrRacket is failing to parse the first line.yes ,it doesn't help .But 
still thanks



Does that mean you still can't open the file?  Inserting a blank line 
with another editor worked for me.


George

--
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] I can't open my previous file

2016-06-06 Thread 张可星
在 2016年6月6日星期一 UTC+8下午2:26:41,gneuner2写道:
> On 6/6/2016 2:05 AM, 张可星 wrote:
> > 在 2016年6月6日星期一 UTC+8下午1:44:39,gneuner2写道:
> > > On 6/5/2016 11:18 PM, 张可星 wrote:
> > > > When I open my file ,Dr racket told me as below
> > > >
> > > > `在读取/home/richard/桌面/TheGame.rkt时出现错误.
> > > > insert-file in text%: error loading the file (read-from-file-failed)`
> > > >
> > > > all my code are lost ,what can I do now?
> > > > I use Drracket 6.5 on ubuntu 16.04lts
> > > > I find the same issue here
> > > > http://lists.racket-lang.org/users/archive/2011-October/048596.html
> > > > But it doesn't help
> > > > As the same ,I do have picture in my code.
> > > >
> > >
> > > Is it possible you (or somebody else) opened the file in another
> > > editor?  I have seen a variety of problems in DrRacket when another
> > > editor has written a UTF-8 BOM header into a source file.
> > >
> > > If that is that case, opening the file in a plain text editor and
> > > removing the first 2 characters should fix it.
> > >
> > > George
> >
> > yes ,I can open it in a plain text editor.
> > I open it in gedit
> >
> > but there is nothing to delete
> >
> > see the attachment
> 
> Open the file with a text editor and insert a blank line at the 
> beginning.  Then DrRacket will open it.  I haven't seen this particular 
> issue previously, but obviously DrRacket is failing to parse the first line.
> 
> George

obviously DrRacket is failing to parse the first line.yes ,it doesn't help .But 
still thanks

-- 
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] I can't open my previous file

2016-06-06 Thread George Neuner

On 6/6/2016 2:05 AM, 张可星 wrote:

在 2016年6月6日星期一 UTC+8下午1:44:39,gneuner2写道:
> On 6/5/2016 11:18 PM, 张可星 wrote:
> > When I open my file ,Dr racket told me as below
> >
> > `在读取/home/richard/桌面/TheGame.rkt时出现错误.
> > insert-file in text%: error loading the file (read-from-file-failed)`
> >
> > all my code are lost ,what can I do now?
> > I use Drracket 6.5 on ubuntu 16.04lts
> > I find the same issue here
> > http://lists.racket-lang.org/users/archive/2011-October/048596.html
> > But it doesn't help
> > As the same ,I do have picture in my code.
> >
>
> Is it possible you (or somebody else) opened the file in another
> editor?  I have seen a variety of problems in DrRacket when another
> editor has written a UTF-8 BOM header into a source file.
>
> If that is that case, opening the file in a plain text editor and
> removing the first 2 characters should fix it.
>
> George

yes ,I can open it in a plain text editor.
I open it in gedit

but there is nothing to delete

see the attachment


Open the file with a text editor and insert a blank line at the 
beginning.  Then DrRacket will open it.  I haven't seen this particular 
issue previously, but obviously DrRacket is failing to parse the first line.


George

--
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] I can't open my previous file

2016-06-06 Thread 张可星
在 2016年6月6日星期一 UTC+8下午1:44:39,gneuner2写道:
> On 6/5/2016 11:18 PM, 张可星 wrote:
> > When I open my file ,Dr racket told me as below
> >
> > `在读取/home/richard/桌面/TheGame.rkt时出现错误.
> > insert-file in text%: error loading the file (read-from-file-failed)`
> >
> > all my code are lost ,what can I do now?
> > I use Drracket 6.5 on ubuntu 16.04lts
> > I find the same issue here
> > http://lists.racket-lang.org/users/archive/2011-October/048596.html
> > But it doesn't help
> > As the same ,I do have picture in my code.
> >
> 
> Is it possible you (or somebody else) opened the file in another 
> editor?  I have seen a variety of problems in DrRacket when another 
> editor has written a UTF-8 BOM header into a source file.
> 
> If that is that case, opening the file in a plain text editor and 
> removing the first 2 characters should fix it.
> 
> George

yes ,I can open it in a plain text editor.
I open it in gedit 

but there is nothing to delete

see the attachment 

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


TheGame.rkt
Description: Binary data