Re: [racket-dev] [racket] DrRacket needs work

2011-11-27 Thread Neil Toronto

Moving to dev.

16x16 is tiny! But I can see why. I've attached my current toolbar, 
which uses all 22px icons. They look a bit big.


I'm doing more than just replacing icons. We need abstractions. Not 
having them is partly why DrRacket's icon set looks old and 
inconsistent. So here's what I've been working on.


1. SVG icon sources in icons/svg, organized in sub-directories.

2. icons/svg/render-png.rkt, which renders all the SVG sources at 
different heights (16, 24, 32, 48), in further sub-directories.


3. icons/svg/load-icon.rkt, which contains functions that make it easy 
to load icons: it builds file names from info like style and height.


The last also has functions for composing icons at runtime, and 
abstractions for common compositions. For example, this would make a 
blue, diffuse version of the wide macro stepper icon:


   (icon-ht-append (load-icon misc hash-quote-diffuse height)
   (step-icon blue diffuse height))

And `step-icon' builds an icon by appending a triangle and a bar.

Today, I'm going to change render-png.rkt to colorize icons by replacing 
certain named gradients in the SVG sources.


Critiques or suggestions?

Also, I have questions.

1. Do icons have to be loaded with 'png/mask? Combining masked bitmaps 
is kind of a pain.


2. What would you (or anyone) think of using Inkscape or another SVG 
renderer as part of the build? Would it be better to not require it, and 
just have anybody who changes the SVG sources re-run render-png.rkt?


Neil T

(Jay, before you get anxious about the FLOPS deadline, I've been working 
on that, too. But this has been keeping my mind off being nauseated. I'm 
just thankful I'm sick now instead of on Thanksgiving, like my little 
brother. Hopefully, by now he can enjoy the piece of donut-cherry pie I 
sent home with his wife.)


On 11/27/2011 12:59 AM, Robby Findler wrote:

It has to be 16x16, not 24x24, sadly.

I wouldn't mind if you committed something that was just the checkmark
and the right size in collects/icons/syncheck.png.

Robby

On Sat, Nov 26, 2011 at 2:07 PM, Neil Torontoneil.toro...@gmail.com  wrote:

I had some hours to kill today, and I figured I could come up with
replacements for the toolbar icons at least.

Neil T
attachment: toolbar.png_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] [racket] DrRacket needs work

2011-11-27 Thread Neil Toronto

On 11/27/2011 01:28 PM, Robby Findler wrote:

On Sun, Nov 27, 2011 at 2:02 PM, Neil Torontoneil.toro...@gmail.com  wrote:
Thanks for taking this on, Neil!


:)


No no, that's just from back before we had alpha bitmaps. Please get rid of it!


Roger roger. Just loading them with 'png/alpha seems to work fine. Cool.


2. What would you (or anyone) think of using Inkscape or another SVG
renderer as part of the build? Would it be better to not require it, and
just have anybody who changes the SVG sources re-run render-png.rkt?


I think, at this point, better not to require it.


Gotcha. The rendered PNGs will be binaries in the repo.


But we do need an svg library in Racket. If I were doing it I'd make
something that loads an svg into a data structure that can be passed
across places and have a separate draw this svg into a dc function
(or maybe turn it into some other racket/draw thing, as appropriate).
I guess this should go into racket/draw, too.


That would eventually be awesome, especially for using 2D game assets 
developed in Illustrator or Inkscape. The dc interface would have to 
have gradients and blurring first.


I'm not taking this one on right now. :)

Neil T
_
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] Disable/Enable Tests

2011-11-27 Thread Robby Findler
[ moved to dev ]

Apparently this broke somewhere in between v5.0 (June 2010) where it
works and v5.1 (Feb 2011) where it doesn't. I can't use git bisect to
find the precise commit because the earlier version doesn't compile on
either my windows or my mac machine (mac is lion and windows uses too
new of a version of visual studio).

And I *hate* touching this code because something always ends up
broken. I got really mad last time this code broke and so I hope we
have better test suites now because of that, but I'm really not
excited by the prospect of trying to change it again. Not only is the
code hard to understand because it is poorly written, it is also
unclear what parts of DrRacket it influences.

Given all of this, my inclination is to simply remove this option. So
far the only one who has spoken in favor of it gave a reason that
(thankfully) no longer applies.

Any objections? Comments?

Mike?

Robby

On Sun, Nov 27, 2011 at 8:24 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote:
 It doesn't appear to do anything at the moment -- it's only effect is
 to set a preference (buggily) which is only examined by the menu item,
 not by any testing code. I've been unable to determine when it stopped
 working via code archeology, but it was probably quite a while ago.

 On Sun, Nov 27, 2011 at 8:17 PM, Mark Engelberg
 mark.engelb...@gmail.com wrote:
 In the latest version of Racket, I see a menu item to disable and
 enable tests.  What testing library does this work with?  The htdp
 testing library, rackunit, something else?

 Thanks,

 Mark
 _
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users




 --
 sam th
 sa...@ccs.neu.edu

 _
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users


_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] [racket] Disable/Enable Tests

2011-11-27 Thread Robby Findler
Does anyone know how to grep backwards through the history of a file, using git?

Robby
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] Disable/Enable Tests

2011-11-27 Thread Sam Tobin-Hochstadt
On Sun, Nov 27, 2011 at 11:22 PM, Robby Findler
ro...@eecs.northwestern.edu wrote:
 Does anyone know how to grep backwards through the history of a file, using 
 git?

I'd do this:

% cd collects/test-engine
% git log -p -Senable .

where 'enable' might be something else.

However, that exact query shows that either you broke the code in
commit 1b29fd590b which I find unlikely from the text of the commit,
or it was something not found by that query. :(

-- 
sam th
sa...@ccs.neu.edu
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] Disable/Enable Tests

2011-11-27 Thread Robby Findler
Okay. Thanks, Sam and Eric.

It appears that in 5.1 check-expect didn't work at all (is that
possible?!) so I guess that trying to look through the history to find
something helpful is probably a waste of time.

And, FWIW, the commit I did below could have been the source of
problems, as it changes the timing of how preferences work (especially
related to saving prefs in drracket's space thread and then looking
them up in the user's space) which could easily have had something to
do with breaking this feature. (It is a bad idea for code to expect to
trying to communicate between those two places via the filesystem, but
that's no excuse for me missing this problem. Sigh.)

Robby

On Sun, Nov 27, 2011 at 10:30 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote:
 On Sun, Nov 27, 2011 at 11:22 PM, Robby Findler
 ro...@eecs.northwestern.edu wrote:
 Does anyone know how to grep backwards through the history of a file, using 
 git?

 I'd do this:

 % cd collects/test-engine
 % git log -p -Senable .

 where 'enable' might be something else.

 However, that exact query shows that either you broke the code in
 commit 1b29fd590b which I find unlikely from the text of the commit,
 or it was something not found by that query. :(

 --
 sam th
 sa...@ccs.neu.edu

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Missing pregexp syntax in Racket

2011-11-27 Thread David T. Pierson
On Sat, Nov 26, 2011 at 10:35:57PM -0800, Pauan wrote:
 It was brought up that my explanation was confusing, and I agree it is.
 So I'll try again. The following should return #t:
...
 (regexp-match? \\n        \n)

I am confused about a number of things in your emails, so for simplicity
I'm focusing on the above expression only.

Your email subject mentions pregexp, but your pattern is a string
literal, which AFAICT will be compiled into a regular expression using
regexp not pregexp.  Therefore it isn't clear whether you are suggesting
a change to regexp syntax or pregexp syntax.

Currently, #rx\\n matches like #rxn and #px\\n is an error:

 (regexp-match? #rx\\n n)
#t
 #px\\n
readline-input::569: read: bad pregexp string: illegal alphabetic escape

Both of these behaviors agree with the syntax documented at

http://docs.racket-lang.org/reference/regexp.html?q=regexp-match%3F#(part._regexp-syntax)

To add to my confusion, your original email mentioned #pxn, which
currently matches a backslash followed by an 'n'.

Perhaps you are suggesting that #px\\n should mean the same as
#px\n rather than being an error?  I don't see a need for this but
perhaps you have a rationale in mind?

David
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] [racket] Disable/Enable Tests

2011-11-27 Thread Robby Findler
Turns out that this commit was part of the problem. I didn't udpate
all of the uses of those preferences properly.

Robby

On Sun, Nov 27, 2011 at 10:30 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote:
 On Sun, Nov 27, 2011 at 11:22 PM, Robby Findler
 ro...@eecs.northwestern.edu wrote:
 Does anyone know how to grep backwards through the history of a file, using 
 git?

 I'd do this:

 % cd collects/test-engine
 % git log -p -Senable .

 where 'enable' might be something else.

 However, that exact query shows that either you broke the code in
 commit 1b29fd590b which I find unlikely from the text of the commit,
 or it was something not found by that query. :(

 --
 sam th
 sa...@ccs.neu.edu

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Missing pregexp syntax in Racket

2011-11-27 Thread ozzloy-racket-dev
i'll take a stab at clarifying.
there was some discussion on irc about being able to represent regexpes
using less escaping.
it was suggested that we could have something similar to perl, ruby,
javascript and other languages for specifying a regexp pattern, something
like #rx/pattern/
so for example you could type
(regexp-replace* #rx/\bregex\b/ text regexp)
instead of
(regexp-replace* #px\\bregex\\b text regexp)

it turns out there are some patterns that need to be added to racket before
we could do something like that.  creating a pattern that matches a newline
involves writing a pattern that has a newline in it, rather than a pattern
with a backslash followed by an 'n'.

(regexp-match? #rx\n \n) = #t
(regexp-match? #px\n \n) = #t
(regexp-match? #rx\\n \n) = #f
(regexp-match? #rx\\n n) = #t
(regexp-match? #px\\n \n) = raises read: bad pregexp string: illegal
alphabetic escape

pauan went through and found all such missing escapes and reported them.

On Mon, Nov 28, 2011 at 00:48, David T. Pierson d...@mindstory.com wrote:

 On Sat, Nov 26, 2011 at 10:35:57PM -0800, Pauan wrote:
  It was brought up that my explanation was confusing, and I agree it is.
  So I'll try again. The following should return #t:
 ...
  (regexp-match? \\n\n)

 I am confused about a number of things in your emails, so for simplicity
 I'm focusing on the above expression only.

 Your email subject mentions pregexp, but your pattern is a string
 literal, which AFAICT will be compiled into a regular expression using
 regexp not pregexp.  Therefore it isn't clear whether you are suggesting
 a change to regexp syntax or pregexp syntax.

 Currently, #rx\\n matches like #rxn and #px\\n is an error:

  (regexp-match? #rx\\n n)
 #t
  #px\\n
 readline-input::569: read: bad pregexp string: illegal alphabetic escape

 Both of these behaviors agree with the syntax documented at


 http://docs.racket-lang.org/reference/regexp.html?q=regexp-match%3F#(part._regexp-syntax)

 To add to my confusion, your original email mentioned #pxn, which
 currently matches a backslash followed by an 'n'.

 Perhaps you are suggesting that #px\\n should mean the same as
 #px\n rather than being an error?  I don't see a need for this but
 perhaps you have a rationale in mind?

 David
 _
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev