[racket] Racket newbie questions

From: John Gateley (racket at jfoo.org)
Date: Sun May 5 22:45:20 EDT 2013

Lots of newbie questions:

1) If I am creating a new class that has a "size" field, what is the
convention for naming the initialization argument? "size" doesn't
work! This name must be known by all class creators.
(class object %
   (init init-size) ;; init-size cannot be size
   (define size init-size)
   ...)

2) In DrRacket, where is the "save all" menu item? Can I configure
DrRacket so that when I "Run" (by clicking the Run button) the
files in the definitions area are automatically saved?

3) Are there Eclipse, NetBeans or Visual Studio plugins for Racket?

4) Do you have real-world examples of why (super-new) would not be
called before anything else in a class?

5) Is there an implementation of vectors that can change in size?
Like C++'s std::vector?

6) Finally, for tonight, here's a way to crash DrRacket in 64
bit Windows 7. I've attached two files, main.rkt and manuscript.rkt.
Start DrRacket, open "main.rkt", open "manuscript.rkt" (which
opens a second window), switch to the "main.rkt" window, press
the "Run" button, then press the "Debug" button. You get the dreaded
"DrRacket has stopped working" dialog.

Thanks,

John
-------------- next part --------------
#lang racket
 
(require "manuscript.rkt")

(define voynich-root "C:\\Users\\gateley\\My Documents\\Voynich")

(define voynich-lossless (string-append voynich-root "\\lossless"))

(define (main)
  (define voynich (new manuscript [arg-root-path voynich-lossless]))
  (for ([file (directory-list voynich-lossless)])
    (send manuscript add-file file)))

-------------- next part --------------
#lang racket

; A manuscript is a list of folios
; It contains the root directory of the pngs


(provide manuscript)

(define manuscript
  (class object%
    (super-new)
    (init arg-root-path) ;; what is the convention for constructor arguments? How do we specify the argument name and then the member field name?
    
    (define root-path arg-root-path)
    
    (define folios (make-vector 200))
    
    (define (add-file file)
      (write file))
  ))


Posted on the users mailing list.