diff --git a/collects/profjWizard/class.scm b/collects/profjWizard/class.scm index 5d1fad7724..54ac7cdc14 100644 --- a/collects/profjWizard/class.scm +++ b/collects/profjWizard/class.scm @@ -1,4 +1,3 @@ -#cs (module class mzscheme (require "data-defs.scm" (lib "contract.ss") @@ -38,7 +37,7 @@ [super (cadr the-class)] [fields (caddr the-class)] [prps (class-purpose the-class)]) - (define templates + (define templates (if (or (not template?) (eq? language BEGINNER)) "" (enumerate-with-separator diff --git a/collects/profjWizard/todo b/collects/profjWizard/todo index 1f5e43f910..a9426a688b 100644 --- a/collects/profjWizard/todo +++ b/collects/profjWizard/todo @@ -49,6 +49,9 @@ view FEATURES: +** re-enable the method template creation in view +== the creation of method stubs depends on language level + ** allow the introduction of an abstract class for common features in Unions (common fields, common methods) diff --git a/collects/profjWizard/tool.ss b/collects/profjWizard/tool.ss index 478d59c1bd..08d5bdd1a1 100644 --- a/collects/profjWizard/tool.ss +++ b/collects/profjWizard/tool.ss @@ -1,4 +1,3 @@ -#cs (module tool mzscheme (require "class.scm" "union.ss" @@ -41,9 +40,8 @@ (super-new) - (define (tee x) x) - - #;(define-syntax tee + #; + (define-syntax tee (syntax-rules () ((_ x) (let* ([a (format "--> ~a\n" 'x)] @@ -51,7 +49,9 @@ [b (format "==> ~a\n" y)]) (message-box "error" (format "~a~a" a b)) y)))) - + + (define (tee x) x) + ;; String (LANGUAGE-LEVEL -> X) (X ... -> String) (X ... -> String) -> Void ;; create a menu item for inserting classes and interfaces (define (make-menu-item% descr get-info make draw) @@ -67,12 +67,15 @@ ;; --------------------------------------------------------------- (define language-level - (let ([simple* (member "ProfessorJ" current-language*)]) + (let* ([simple* (tee (member "ProfessorJ" current-language*))] + [begin-> (tee (and simple* (cadr simple*)))]) + (tee (cond + [begin-> begin->] [(boolean? simple*) PROFESSIONAL] [(eq? (cadr simple*) BEGINNER) BEGINNER] [(eq? (cadr simple*) INTERMEDIATE) INTERMEDIATE] - [else PROFESSIONAL]))) + [else PROFESSIONAL])))) ;; get the editor and insert the desired items ... (define editor (get-edit-target-object)) diff --git a/collects/profjWizard/view.scm b/collects/profjWizard/view.scm index bb5b1f9a6d..3be9034f14 100644 --- a/collects/profjWizard/view.scm +++ b/collects/profjWizard/view.scm @@ -1,4 +1,3 @@ -#cs (module view mzscheme (require "assoc-list.scm" @@ -131,23 +130,24 @@ ;; switches for toString methods and template in comments (define switch-pane (add-horizontal-panel p)) - (define-values (string template diagram) + (define-values (string #;template diagram) (cond [switches? - (values (make-checkbox switch-pane ADD-TOSTRING) + (values (make-checkbox switch-pane ADD-TOSTRING) + #; (let ([c (make-checkbox switch-pane ADD-TEMPLATE)]) (send c set-value #t) c) (make-checkbox switch-pane ADD-DIAGRAM))] - [no-diagram (values #f #f #f)] - [else (values #f #f (make-checkbox switch-pane ADD-DIAGRAM))])) + [no-diagram (values #f #;#f #f)] + [else (values #f #;#f (make-checkbox switch-pane ADD-DIAGRAM))])) (define (get-switch x) (cond [(eq? x diagram) (and (not no-diagram) (send x get-value))] [switches? (send x get-value)] [else #f])) (define/public (tostring?) (get-switch string)) - (define/public (template?) (get-switch template)) + (define/public (template?) #;(get-switch template) #f) (define/public (diagram?) (get-switch diagram)) ;; -------------------------------------------------------------------- @@ -246,7 +246,7 @@ super-name (if (null? a-super) #f SUPER)) (send field-panel produce) (send purpose get-value)) - (tostring?) + (tostring?) (template?)))) ;; if the class specification is proper, hide dialog