More on Dates

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

More on Dates

Francisco Garau-2
Thanks for the suggestions on my previous post.

I am aware of the work done in Chalten by the Mercap guys. In fact, I read
it quite carefully and took several ideas from there. One of the things I
like most is the immutability of date objects.

I want that the printString of a date returns an equivalent objects. In
code:

    '30-Apr-06' actualDate printString
    =>  '2006 year april day30'

>From the suggestions received, the one using the comma seems the more
elegant (2006 year april, 30). But it requires parenthesis. Once a date
receives the #weekday message, it calculates the julian day number, and from
then on the weekday is cached. Now the printString is getting bigger.

    '30-Apr-06' actualDate weekday; printString
    => '2006 year april day30 sunday'

Now I have another method to generate these boring ones.

    TmActualDate class>>generateMethods
        #(sunday monday tuesday wednesday thursday friday saturday) collect:
[:each |
            self fakeCompile:
                (String streamContents:
                    [:stream |
                    stream
                        nextPutAll: each; cr; tab;
                        nextPutAll: '^ self' ] ) ]

- Francisco

PD: During Esug 2004, Dan Ingalls showed Smalltalk-72 and the original
Smalltalk-80 running inside Squeak. Does anybody know how to get those
images?





Reply | Threaded
Open this post in threaded view
|

St-72 and St-80 [was: More on Dates]

Dan Ingalls
"Francisco Garau" <[hidden email]>  wrote...

>PD: During Esug 2004, Dan Ingalls showed Smalltalk-72 and the original Smalltalk-80 running inside Squeak. Does anybody know how to get those images?

Hmm.  Well, you could ask him ;-)

The Smalltalk-72 emulation is on SqueakMap, but I have just verified that it does not run in 3.9, and there's a fair chance it runs in nothing else since 3.4 in which it does run.  So I'll set about getting it to run again in 3.9.  I think it's a simple problem about how literals print and read.

The Smalltalk-80 was done as part of a port of Vassily Bykov's Hobbes.  I'll have to check with him about releasing it.  Also it has a few bugs on little-endian machines, but they should be easy to fix.

Finally I have been meaning to put out a Smalltalk-76 done in a similar manner.  This is the true root of Squeak.  I was going to do this for HOPL-III, but I'm afraid I ran out of time (sigh).

        - Dan

Reply | Threaded
Open this post in threaded view
|

Re: St-72 and St-80 [was: More on Dates]

Wolfgang Helbig-2
Hi List,
Dan Ingalls wrote,

>"Francisco Garau" <[hidden email]>  wrote...
>
>>PD: During Esug 2004, Dan Ingalls showed Smalltalk-72 and the original
Smalltalk-80 running inside Squeak. Does anybody know how to get those images?
>
>Hmm.  Well, you could ask him ;-)
>
I worked for me :-).
Thank you, Dan!
>The Smalltalk-80 was done as part of a port of Vassily Bykov's Hobbes.  I'll
have to check with him about releasing it.

Please do.

> Also it has a few bugs on little-endian machines, but they should be easy to
fix.

All I can say, I kind of "fixed" it, by just pretending there is no
Endianess Problem. With this fix, Hobbes works very well on the Unix-VM
on solaris x86. It has a good documentation and implementation of the
Alto Disk and its file system, which I'm exploring right now.

>
>Finally I have been meaning to put out a Smalltalk-76 done in a similar manner.
 This is the true root of Squeak.

Ooops. Didn't know that. Thought it was Smalltalk-80. So now I'll have to
see how the ST-76 Emulator works :-). But seriously, in what aspect is ST-76
the "true" root? Does Squeak have anything in common with ST-76 that is not
part of ST-80?

Regards,

Wolfgang

--
Weniger, aber besser.