A stupid newbie question

Justin Walsh jwalsh at bigpond.net.au
Mon Oct 8 23:04:32 UTC 2001


Hi Patrick!
I have read all of the replies so far to your question and must admit that
if I were in your position I would not be any the wiser.
I think most of the respondents chose to answer the technical part of your
question first because they themselves do no really know the answer. Or even
care. Hacking is always easier.
Understanding why one would not want to create exe's is to understand the
very reason Alan Kay designed Smalltalk in the first place.
Alan Kay proudly says that he did not invent C++. Yet why was he so helpless
to stop the C++ rot?  Was it because, even he hadn't thought  it through
thoroughly enough all those years ago. Maybe does not know?
Smalltalk is currently being hacked to death by refugees from the C and C++
community.
If you are an obsessive coder then there is very little hope for you I'm
afraid. With me it was assembler. A total mindshift is required.
The gradual degradation of Smalltalk (in general) from it's pure beginnings
lies in the capacity of C and C++ enthusiasts to  toggle between Objects and
lines of code. No commitment to principle required.
The result is the  dependency on that  most grotesque "object" (macro exe)
called the .dll.
There is no more reason left to solve the actual problem from the top down,
or even from the middle down, first.  Which is where humans, as distinct
from animals usually begin.
Just slide along the bottom. It is easier. In a few years even MVC will be
non existant.
I suggest that you put the coding aside and read Alan Kays initial missions
statements. Otherwise you will do more damage than good.
There is  need for a separate list where these sort of newbie (not so
stupid) questions can be put without upsetting  bottom dwellers. If there is
already one then tell me and I'll get off the line myself.
Someone will no doubt find a way to create your beloved exe.
Jw

----- Original Message -----
From: "Patrick Castle" <lemeia at bigpond.com>
To: <squeak-dev at lists.squeakfoundation.org>
Sent: Sunday, October 07, 2001 4:42 AM
Subject: A stupid newbie question


>
> Hi all,
>
> I'm having a particular problem which is probably laughably stupid and
> although I managed a workaround the whole implementation is looking really
> sloppy.
>
> I'm trying to implement an example from the book: 'Discovering
Smalltalk' -
> the TicTacToeGame if anyone is interested.
>
> Now I know some of the code won't work as it isn't written for Squeak. I
> have translated it as best I can and have actually managed to implement a
> full solution.
>
> However.....
>
> The idea is to prompt the user for a simple point on a 3x3 grid meaning:
> answer isKindOf: Point.
> But when implementing..
>
>
> |aPoint|
>
> aPoint := FillInTheBlank
> request: 'Next move?'
> initialAnswer: '1 at 1'.
>
> ..a String is bound to the aPoint variable.
>
> As part of the move's validation process a method is used to determine
> firstly whether the user has actually entered a point and secondly whether
> the point is valid. But it won't even pass the    aPoint isKindOf: Point
> test.
>
> Now feel free to laugh out loud at my workaround, but this is how I turned
> achieved the desired result:
>
>
> |aPoint|
>
> aPoint := FillInTheBlank
> request: 'Next move?'
> initialAnswer: '1 at 1'.
> aPoint := Point x: ((aPoint at: 1) asInteger - 48) y: ((aPoint at: 3)
> asInteger - 48).
>
>
> This binds a Point instance to aPoint which is the desired outcome.
However,
> I don't personally think the workaround is very acceptable. For a start I
> could enter 'Johnny Rotten' and the application would happily convert my
> answer into a Point instance which I think is very sloppy. I would need an
> extra layer of validation to stop this. Mind you - any string other than
the
> legal values for the game will come up with an 'illegal move' response (or
> at least they seem to).
>
> So my question is how to a turn a String response '1 at 1' into Point
instance
> 1 at 1? And it actually opens up a larger question for me. Using
> FillInTheBlank, how to I return anything other than String objects? From
my
> example it seems that if I had used the class to prompt me for a number I
> would be return '5' rather than 5, which isn't much use if I'm wanting to
> make calculations with the answer.
>
> I know the answer would have to be very simple, but I just haven't found
the
> solution in the class library yet, or any tutorials or books I have.
>
> Just to try your patience I thought I'd add another question.
>
> Now that I have the application functioning I would like to make it into
an
> .exe file to see how it functions outside of the Squeak development
> environment. The only info I've found so far on doing this is to type:
>
> CCodeGenerator new initialize addClass: ClassName) codeString.
>
> Inspecting this gives me some C code with an #include 'sq.h'  line in it.
I
> don't have this header file so where would I get it? Is this all I need to
> do to turn a Squeak application into an .exe?
>
> I'm presuming I would have to do this with all Classes I create to make
the
> application plus any other pre-existing Classes I have modified or created
> that happen to be used within the application.
>
> I have a GNU C/C++ compiler so I'm guessing that should be enough for
> compilation.
>
> Thanks for perservering.
>
> Regards
> Patrick
>
>
>
>





More information about the Squeak-dev mailing list