[plt-scheme] DrScheme Interactions window

From: Connor Ferguson (psfreak at linkline.com)
Date: Sat May 8 21:30:35 EDT 2004

This sounds great. I think I will need to modify it so that the GUI will
have two text fields one for the subject and one for the verb.

The only thing is, I have defined a verb as a structure and have then
defined individual verbs. So my program takes a string and a verb (struct)

(define-struct verb (inf yo tu 3sing nos vos 3plural))
(define ser (make-verb "ser" "soy" "eres" "es" "somos" "sois" "son"))

Correct me if I'm wrong, but information placed into a text field in a GUI
is considered a string. Could I possibly solve this problem by modifying my
verb definitions as such:

(define "ser" (make-verb "ser" "soy" "eres" "es" "somos" "sois" "son"))

Also, will this executable require DrScheme to be installed on the computer
that it is running on and is it universal?

As for my OS X, I am constantly harping on my parents telling them that it
is absolutely vital for what I want to do with my computer that I get an
upgrade to OS X, but they don't seem to get the point. It'll happen
eventually, though.

Thanks,
-Connor

>>on 5/8/04 5:10 PM, Matthias Felleisen wrote:

> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> Your best bet is to use the GUI teachpack and otherwise
> you follow the directions given below.
> 
> (module spanish mzscheme
> (require (lib "plt-pretty-big.ss" "lang") (lib "gui.ss" "htdp"))
> 
> ;; --- Connor starts here
> 
> ;; --- Model
> ;; String -> String
> (define (conjungate word)
> "I don't know anything.")
> 
> ;; --- GUI
> (define txt (make-text "hello"))
> (define msg (make-message "the result in Spanish"))
> 
> ;; Event -> Boolean
> (define (callback e)
> (draw-message msg (conjungate (text-contents txt))))
> 
> (define doit (make-button "Conjungate" callback))
> 
> ;; Event -> Boolean
> (define (quit e)
> (hide-window the-window))
> 
> (define quit-button (make-button "Quit" quit))
> 
> (define the-window (create-window (list (list txt msg doit)
> (list quit-button))))
> ;; --- end
> )
> 
> When you add the module wrapper, go to the MODULE language.
> 
> When you use create executable, use the options STAND ALONE and MRED.
> 
> Your application will have the name of the module, not the drscheme
> name. It will have the DrScheme icon. I don't know how to change this
> under Mac 9. Perhaps Matthew or someone else knows. I am a newly
> convinced Mac users.
> 
> -- Matthias
> 
> P.S. When are you getting your OS X box?
> 
> On May 8, 2004, at 7:54 PM, Connor Ferguson wrote:
> 
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> 
>> Actually, I'm developing a program that conjugates verbs in Spanish and
>> French. I'd need of course to have some way of putting the information
>> needed for conjugation (the subject of the sentence and the infinitive
>> of
>> the verb). I'd also prefer this to run in its own application with a
>> name of
>> my choice (even if it only looks that way and in reality it is running
>> in
>> DrScheme). Also remember that I am only working in version 204.
>> 
>> -Connor
>> 
>>>> on 5/8/04 2:38 PM, Matthias Felleisen wrote:
>> 
>>> For list-related administrative tasks:
>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>> 
>>> Connor, it sounds like you want to create an executable
>>> from your UFO game. For simplicity, let's consider a
>>> rocket launch instead, modeled with the new animation
>>> feature from 207:
>>> 
>>>> (module gamex mzscheme
>>>> 
>>>> (require (lib "plt-pretty-big.ss" "lang") (lib "draw.ss" "htdp"))
>>>> ;; ---- Connor started writing here:
>>>> (define (where-x t) (+ 20 (* 2 t)))
>>>> (define (where-y t) (- 300 (* 1/2 9.8 t t)))
>>>> 
>>>> (start 300 300) ;; create canvas
>>>> (big-bang .8 0) ;; clock ticks every .8 of a second, world is a
>>>> natural number
>>>> (on-tick-event  ;; World -> World
>>>> (lambda (t)
>>>> (draw
>>>> (draw-solid-disk (make-posn (where-x t) (where-y t)) 5 'white)
>>>> ;; erase old
>>>> (draw-solid-disk (make-posn (where-x (+ t 1)) (where-y (+ t
>>>> 1))) 5 'red) ;; draw new
>>>> produce
>>>> (+ t 1))))
>>>> ;; ---- That's all
>>>> )
>>> 
>>> When you're done developing, wrap it with the three
>>> lines that you see above. Make sure the name of the
>>> file is gamex.ss. Then select Scheme | Create Executable.
>>> 
>>> You will see a DrScheme-like icon on your finder (file menu)
>>> and you can double-click it.
>>> 
>>> -- Matthias
>>> 
>> 
> 



Posted on the users mailing list.