Stephen Woolerton's blog

C Callouts #2


And here is a second tutorial on C callouts from GNU Smalltalk.

C Callouts


I've posted an intro on how to do C Callouts from GNU

Smalltalk problem for someone - extract firstname,lastnames

The issue is to extract the firstname and lastNames from a string called fullname.

e.g. fullname of "michael john horatio bassett" -> firstname "michael" and lastnames "john horatio bassett"

Below is the code that got the job done in the short time I had, but its not a Smalltalk solution. if anyone would like to post Smalltalkish solutions that would be great.

Observations on the development process

When using other scripting languages for server scripting, the result has been a file (sometimes large), but generally a single file.

I'm finding I now do things differently and I think better in GST. So here is the process now:-

  • Break the task into pieces which seem like objects (an Object manages its own data. If in doubt I just pick a chunk of work which seems autonomous and start there)
  • Make a class for the task, and then write at least one test method for the class. So in my FooBar class, there'll be a method something like:-
    test [
           | fooBar |

Figuring out a new library

One thing I've come across with open source Smalltalks is that there is often no formal documentation for a Library.

So, coming from Java and commercial programming, I'm like "where is the documentation and an example?".

Syndicate content

User login