<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 6, 2013 at 10:46 PM, John Gateley <span dir="ltr"><<a href="mailto:racket@jfoo.org" target="_blank">racket@jfoo.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here's a summary of the responses. Thanks to everyone who<br>
replied. My comments are in [ and ]. Not much new though.<div class="im"><br>
<br>
<br>
On 5/5/2013 9:45 PM, John Gateley wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Lots of newbie questions:<br>
<br>
1) If I am creating a new class that has a "size" field, what is the<br>
convention for naming the initialization argument? "size" doesn't<br>
work! This name must be known by all class creators.<br>
(class object %<br>
(init init-size) ;; init-size cannot be size<br>
(define size init-size)<br>
...)<br>
</blockquote>
<br></div><div class="im">
You can use internal names to make this work:<br>
<br>
(class object%<br>
(super-new)<br>
(init ([internal-size size]))<br>
(define size internal-size))<br>
<br>
I use a macro that encodes this pattern:<br>
<br>
(define-syntax-rule (init-private field-name)<br>
(begin (init ([internal field-name]))<br>
(define field-name internal)))<br>
<br>
(class object%<br>
(super-new)<br>
(init-private size))<br>
<br></div>
[Thanks!]<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
2) In DrRacket, where is the "save all" menu item? Can I configure<br>
DrRacket so that when I "Run" (by clicking the Run button) the<br>
files in the definitions area are automatically saved?<br>
</blockquote>
<br></div><div class="im">
I agree that a 'Save all' item is missing.<br>
You can bind keyboard shortcuts for that.<br>
<a href="http://docs.racket-lang.org/drracket/Keyboard_Shortcuts.html" target="_blank">http://docs.racket-lang.org/<u></u>drracket/Keyboard_Shortcuts.<u></u>html</a><br>
<br></div>
[also]<br>
<br>
This might work:<br>
<br>
<a href="http://planet.plt-scheme.org/display.ss?package=drsync.plt&owner=grettke" target="_blank">http://planet.plt-scheme.org/<u></u>display.ss?package=drsync.plt&<u></u>owner=grettke</a><br>
<br>
[Looks close, but clicking Run/Debug or anything similar should save<br>
by default, or at least be configurable to do that. You don't want to<br>
run code, verify that it is correct, and exit and with a single slip<br>
of the fingers lose the changes that you just tested.]<div class="im"><br>
<br></div></blockquote><div><br></div><div>Well, this scenario would require multiple slips, as you have to first slip to try to exit and then slip to say "don't save" in the dialog asking you "are you sure you want to exit without saving?".<br>
<br></div>And also there are autosave files (whose existence DrRacket detects when it starts up).<br></div><div class="gmail_quote"><br><div>That's not to say that this shouldn't be configurable. Even better, it seems to me, would be to use mac os x's "auto save" functionality (not the same thing as the auto save I mentioned in the previous sentence).<br>
</div><div><br></div><div>Robby<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
3) Are there Eclipse, NetBeans or Visual Studio plugins for Racket?<br>
</blockquote>
<br></div>
[No responses here. I didn't get to try the debugger environment last<br>
night due to the crash, but I suspect there's a lot of mileage to be<br>
had in exploiting existing debugging environments over creating the<br>
functionality in DrRacket]<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
4) Do you have real-world examples of why (super-new) would not be<br>
called before anything else in a class?<br>
</blockquote>
<br></div><div class="im">
You might want to compute some values to pass as init arguments to the super class. If the computations are big and/or you need to keep references to the values yourself, you might define them as fields before calling super-new. Or they might depend on your own init args, so you would at least declare those first.<br>
<br></div>
[Interesting! I hadn't thought of that, but it seems real. Do you have<br>
any examples?]<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
5) Is there an implementation of vectors that can change in size?<br>
Like C++'s std::vector?<br>
</blockquote>
<br>
<br>
</div><a href="http://docs.racket-lang.org/data/gvector.html" target="_blank">http://docs.racket-lang.org/<u></u>data/gvector.html</a><br>
<br>
[This is close, but I don't see an operation to explicitly grow the<br>
vector, other than adding one element at the end. For some algorithms,<br>
you want to grow the vector exponentially - doubling the size instead<br>
of adding one element.]<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
6) Finally, for tonight, here's a way to crash DrRacket in 64<br>
bit Windows 7. I've attached two files, main.rkt and manuscript.rkt.<br>
Start DrRacket, open "main.rkt", open "manuscript.rkt" (which<br>
opens a second window), switch to the "main.rkt" window, press<br>
the "Run" button, then press the "Debug" button. You get the dreaded<br>
"DrRacket has stopped working" dialog.<br>
</blockquote>
<br></div><div class="im">
Assuming that you're using v5.3.3, can you check whether the crash<br>
happen the current candidate for the next release?:<br>
<br>
<a href="http://pre.racket-lang.org/release/installers/" target="_blank">http://pre.racket-lang.org/<u></u>release/installers/</a><br>
<br></div>
[Indeed, it seems to be fixed.]<br>
<br>
<br>
[Thanks again everyone. No time tonight for much testing, but I will<br>
have more question later. -- j]<div class="HOEnZb"><div class="h5"><br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
</div></div></blockquote></div><br></div></div>