[plt-scheme] DrScheme Interactions window

From: Connor Ferguson (psfreak at linkline.com)
Date: Mon May 10 23:37:27 EDT 2004

I've solved the problem. Basically, I needed to convert the string into a
verb structure. Matthias set me in the right direction with his questions
about a list of all the verbs. I wrote a function, find verb, that takes in
a string and a list of verbs. It then searches to see if verb-inf for each
of the verbs is equal to the string inputted. When it finds the match, it
produces the corresponding verb (struct). I simply applied my conjugation
function to the result of searching my big list of verbs (dictionary) for
the contents of the infinitive text box.

Now that the GUI itself works, though, I need to figure out why the
executable won't work.

I haven't been able to create the executable in Intermediate, so I switched
to Pretty Big. The executable is successfully created, but when I double
click it to open it, it opens a MrEd Standard Output window and gives me
this error message:

cddddr: expects argument of type <cddddrable value>; given
("(module mod-name mzscheme(require(lib
\"pconvert.ss\")(lib\"pretty.ss\"))(provide init-code)(d...

[Exited]

This seems to be the last hurdle for me to jump but this sort of error
message is way beyond my capabilities to decipher.

-Connor

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

> What kind of data do you want to convert the string into? A number?
> A symbol? I am a bit confused here. A GUI editor (that's what the
> box is) must give you the content.
> 
> Can you send me the error message?
> 
> -- Matthias
> 
> P.S. In the meantime, please study " A First Look at GUIs" in HtDP.
> 
> 
> On May 10, 2004, at 10:26 PM, Connor Ferguson wrote:
> 
>>>> on 5/10/04 6:36 PM, Matthias Felleisen wrote:
>>> 
>>>> I have tested the GUI, it came up with the window (I had modified it
>>>> so that
>>>> it had two text fields). When I entered the verb in however, it gave
>>>> me an
>>>> error because it recognized the information in the text field as a
>>>> string.
>>> 
>>> What else would you expect? When you type something in a text field,
>>> the program receives a string. Actually, the string is in a text t
>>> and (text-contents t) extracts the string.
>> 
>> Alright, so is there a way to convert that string to... "not a string"?
>> 
>> -Connor
>> 
>> 
>>>> on 5/10/04 6:36 PM, Matthias Felleisen wrote:
>> 
>>> 
>>> On May 10, 2004, at 8:10 PM, Connor Ferguson wrote:
>>> 
>>>> For list-related administrative tasks:
>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>> 
>>>> I have tested the GUI, it came up with the window (I had modified it
>>>> so that
>>>> it had two text fields). When I entered the verb in however, it gave
>>>> me an
>>>> error because it recognized the information in the text field as a
>>>> string.
>>> 
>>> What else would you expect? When you type something in a text field,
>>> the program receives a string. Actually, the string is in a text t
>>> and (text-contents t) extracts the string.
>>> 
>>>> My verbs that I have defined as one-word variables that include a
>>>> verb
>>>> structure with all the conjugations are not strings. They follow this
>>>> pattern
>>>> 
>>>> (define ser (make-verb "ser" "to be" "soy" "eres" "es" "somos" "sois"
>>>> "son"))
>>>> 
>>>> I tried changing it like so:
>>>> 
>>>> (define "ser" (make-verb "ser" "to be" "soy" "eres" "es" "somos"
>>>> "sois"
>>>> "son"))
>>> 
>>> That's like saying "cat" means dog.
>>> 
>>> My hunch is that you're trying to define a struct with this shape:
>>> 
>>> (define-struct verb (spanish english case1 case2 ...))
>>> 
>>> Now you when you get the spanish or english, you want to look up
>>> the cases.
>>> 
>>> Where is your data definition?
>>> 
>>> Do you keep around a list of verbs? If so, where is your data
>>> definition for your list? Let's call it a dictionary.
>>> 
>>> Do you want to look up the verb in the dictionary. What function
>>> contract do you use? What's the purpose statement? Where are the
>>> examples?
>>> 
>>> All of the above is independent of the GUI. If you look in the last
>>> two
>>> parts of HtDP, you will actually see that the GUI that you're trying
>>> to
>>> build is about 5 lines long. So the above questions are more
>>> important.
>>> 
>>> -- Matthias
>>> 
>>> 
>>>> 
>>>> 
>>>>>> on 5/9/04 5:03 PM, Matthias Felleisen wrote:
>>>> 
>>>>> 
>>>>> On May 9, 2004, at 2:50 PM, Connor Ferguson wrote:
>>>>> 
>>>>>> I have already tested my conjugating program extensively in
>>>>>> Intermediate and
>>>>>> it works.
>>>>> 
>>>>> Did you test the GUI too?
>>>>> 
>>>>>> I tried using exactly the same GUI that you sent me but it still
>>>>>> didn't work.
>>>>> 
>>>>> Did you test the code that I mailed you in Intermediate?
>>>>> Without the header lines and extra ) at the bottom?
>>>>> 
>>>>>> I still do think that I'm going to have to use two separate
>>>>>> text fields because if it is one text field, it will act like a
>>>>>> single
>>>>>> argument, right? My program needs two separate arguments.
>>>>> 
>>>>> Yes you will. -- Matthias
>>>>> 
>>>>>> 
>>>>>> -Connor
>>>>>> 
>>>>>>>> on 5/8/04 7:59 PM, Matthias Felleisen wrote:
>>>>>> 
>>>>>>> Connor, remember the sequence:
>>>>>>> 
>>>>>>> 1. Develop in a teaching language (Intermediate is probably okay).
>>>>>>> 
>>>>>>> 2. Set the teachpack to gui.ss
>>>>>>> 
>>>>>>> 3. Get the program right there.
>>>>>>> 
>>>>>>> 4. Then do the rest.
>>>>>>> 
>>>>>>> 5. If you don't follow those basic rules, the likelihood that the
>>>>>>> problem is yours is 99.9%.
>>>>>>> 
>>>>>>> ;; ---
>>>>>>> 
>>>>>>> If you want to confirm that you can get executables, use the GUI
>>>>>>> that
>>>>>>> I
>>>>>>> mailed you and follow the steps. I'd be extremely surprised if
>>>>>>> they
>>>>>>> don't work. (I will install a 204 if you report otherwise but
>>>>>>> that'll
>>>>>>> take a while. I will also not be happy if I can't reconstruct it.)
>>>>>>> 
>>>>>>> If you do two steps at once, you always end up taking four :-)
>>>>>>> 
>>>>>>> -- Matthias
>>>>>>> 
>>>>>>> 
>>>>>>> On May 8, 2004, at 10:48 PM, Connor Ferguson wrote:
>>>>>>> 
>>>>>>>> Alright, I created the executable and that worked (it showed me
>>>>>>>> the
>>>>>>>> icon).
>>>>>>>> But when I opened it, it opened a MrEd window entitled Standard
>>>>>>>> Output
>>>>>>>> and
>>>>>>>> gave me this error message
>>>>>>>> 
>>>>>>>> cddddr: expects argument of type <cddddrable value>; given
>>>>>>>> ("(module
>>>>>>>> mod-name mzscheme(require(lib \"pconvert.ss\")(lib
>>>>>>>> \"pretty.ss\"))(provide
>>>>>>>> init-code)(d...
>>>>>>>> 
>>>>>>>> [Exited]
>>>>>>>> 
>>>>>>>> The name of the module that I have put in includes spaces. Is
>>>>>>>> that
>>>>>>>> a
>>>>>>>> problem? I also changed the GUI so that it has two text boxes,
>>>>>>>> one
>>>>>>>> for
>>>>>>>> the
>>>>>>>> subject and one for the verb.
>>>>>>>> 
>>>>>>>> -Connor
>>>>>>>> 
>>>>>>>>>> on 5/8/04 7:05 PM, Matthias Felleisen wrote:
>>>>>>>> 
>>>>>>>>> For list-related administrative tasks:
>>>>>>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> On May 8, 2004, at 9:30 PM, Connor Ferguson wrote:
>>>>>>>>> 
>>>>>>>>>> For list-related administrative tasks:
>>>>>>>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>>>>>>>> 
>>>>>>>>>> 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"))
>>>>>>>>> 
>>>>>>>>> Nah, remember that (define XYZ ...) introduces a Scheme name
>>>>>>>>> (XYZ)
>>>>>>>>> to
>>>>>>>>> stand
>>>>>>>>> for some value.
>>>>>>>>> 
>>>>>>>>> You may wish to consider a menu instead of a text field for
>>>>>>>>> input
>>>>>>>>> and
>>>>>>>>> just use lists.
>>>>>>>>> 
>>>>>>>>>> Also, will this executable require DrScheme to be installed on
>>>>>>>>>> the
>>>>>>>>>> computer
>>>>>>>>>> that it is running on and is it universal?
>>>>>>>>> 
>>>>>>>>> You will need DrScheme on other computers just like you need
>>>>>>>>> Windows
>>>>>>>>> on other computers to run your Windows program and OS X to run
>>>>>>>>> your
>>>>>>>>> OS X
>>>>>>>>> program and so on. That's what's called an Operating System and
>>>>>>>>> DrScheme
>>>>>>>>> is just a very high level operating system.
>>>>>>>>> 
>>>>>>>>> -- Matthias
>>>>>>>>> 
>>>>>>>>> P.S. Good luck with your parents.
>>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>> 
>> 



Posted on the users mailing list.