Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.ultranet.com!news.sprintlink.net!howland.reston.ans.net!Germany.EU.net!Hamburg.Germany.EU.net!nuki.NetUSE.de!Kiel.Germany.EU.net!tpki.toppoint.de!mzo.toppoint.de!mzoer
From: mzoer@mzo.toppoint.de (Michael Zoerner)
Subject: Re: A Little More Smalltalk...
X-Newsreader: TIN [version 1.2 PL2]
Organization: home
Message-ID: <1995Jun10.125018.811@mzo.toppoint.de>
References: <id.8ZLK1.8L9@nmti.com>
Date: Sat, 10 Jun 1995 12:50:18 GMT
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Lines: 69

Peter da Silva (peter@nmti.com) wrote:
> Oh, this is tantalizing.

> Little Smalltalk 4 is a nice small interpreter. Unfortunately, it's broken
> somewhere subtle. On the Alpha I get this:

> ./st
> 3711 objects in image
> -> 2000
> ,2,0
> -> 

> ???

> On FreeBSD, I get:

> ./st
> 3711 objects in image
> -> 2000
> can't find method in call
> back trace
> message input (MetaString,)
> message whileTrue: (Block,Block,)
> message input (MetaString,)
> message main (Undefined,)
> message whileTrue: (Block,Block,)
> message main (Undefined,)
> Segmentation fault (core dumped)
> Fatal error in process.

[...]

I ran into this too. I found a glitch in the VM code (interp.c?). 
There is something like this:

    case Branch:
       bytePointer = bp[bytePointer++];

Just leave out the '++' and it should work (this is just from 
memory but I think you will find the lines).

Unfortunatly there are some oddities in the handling of cascaded 
messages and globals in Little Smalltalk 4.0. The following examples 
are also from memory: 
Just try

    ->'Hello ' size; print
    66                         <- should be 'Hello Hello '

This needs compiler modifications (in imageBuilder and image).
Next try

    ->globals at: #Test put: 'test '.
    test 
    ->Test print. globals at: #Test put: 'newval'. Test.
    test test                  <- should be 'test newval'

In general, all compiled methods do not contain references to used
global variables but the values of them at the time of compiling.
This needs extensions in the compiler and VM.

Sorry, I didnt spend any further work on this, so I dont have any 
patches.

Hope this helps,
Michael.
-- 
Michael Zoerner  <mzoer@mzo.toppoint.de>
Kiel/Germany
