[comp.lang.smalltalk] Smalltalk

cs661s02@uhccux.UUCP (Cs661s02) (02/23/88)

What is status of Smalltalk-80 in general?.  Are Smalltalk-80
systems fading into oblivion, left behind by other languages
such as C++(which seems to be gaining momentum),HyperCard(so called
object oriented languge, HyperTalk), and other emerging systems.
And if not, how different smalltalk lang systems diverge from
standard smalltalk image(at least image VII) may end up fragmenting
smalltalk community.  There are now at least 3 different version
of smalltalk systems I think of.  1) ParcPlace System   
2) Tektronix implementation  3) Smalltalk/V  and maybe upcoming
smalltalk release from Apple for Macintosh.  Can we have multiple
standard and still able to preach portability as major strength
of smalltalk systems?.   
What are prospects for new user interface paradigm other than
MVC?.  What kind of serious application is being developing on
smalltalk(any version)?.  I could count number of all commercial
quality smalltalk application on my finger(Humble,Analyst,Inglish?).

Oh well, it's monday and I'm probably too pessimistic and having
not too much to read in comp.lang.smalltalk(or is it fault of news server)

			Sehyo Chang(Smalltalk Hacker)
			Software Engineering Lab
			sec@uhmanoa.ics.hawaii.edu 

-- 
  Sehyo Chang (Smalltalk Hacker) 	ARPA:	uhmanoa!sec@nosc.MIL          
  Software Engineering Research Lab	INTER:	sec@uhmanoa.ICS.HAWAII.EDU    	
  UH/ICS Dept, 2565 The Mall	        UUCP:   sec@uhmanoa.UUCP 
  Honolulu Hi, 96822 (808) 948-6938		      

folta@tove.umd.edu (Wayne Folta) (05/04/89)

I just got Smalltalk/V Mac last night, and I was running through the
book that comes with it.  One of their examples does not work, however, and
I wonder if my question is Smalltalk- or Smalltalk/V-specific: it has to do
with Smalltalk/V's Bags class.  Is this a standard class in most Smalltalk
implementations, or is it Smalltalk/V-specific?

As for the question... they give a program in Pascal that counts the
occurrences of letters in an input string.  Then they show the  Pascal-like
Smalltalk code to do the same thing, which is about 25% shorter.  Then,
they give a "native" Smalltalk version, which is only 5 lines:

   |s f|
   s := Prompter prompt: 'enter line' default: ''.
   f := Bag new.
   s do: [:c | c isLetter ifTrue: [f add: c asLowerCase]].
   ^f

It is impressive to see how much more efficient Smalltalk can be, until you
actually evaluate the program.

The problem is that it *does not* result in an array with the number of
occurrences, it results in a Bag containing all of the letters.  One more
step is needed to get the number of occurrences.  What is the most Smalltalk-
like way (if there is such a thing) to accomplish this?  Maybe something like:

   ^'abcdefghijklmnopqrstuvwxyz' collect: [:c | f occurrencesOf: c]

(Which gives me an error which I--novice that I am--don't understand.)


Wayne Folta          (folta@tove.umd.edu  128.8.128.42)

new@udel.EDU (Darren New) (05/04/89)

Bag is a standard class in Smalltalk-80 as well as st-V.
As for returning it as an array, look under Bag (or
its superclasses) for a message "asArray". If it's there
in ST-V, you could just say ^f asArray. There should
also be things like asString, asSymbol, asSet, ...
		     -- Darren

folta@tove.umd.edu (Wayne Folta) (05/04/89)

You were correct (and I stumbled onto the answer seconds before checking
the news again.)  A working method is:

|s f|
s := Prompter prompt: 'enter line' default: ''.
f := Bag new.
s do: [:c | c isLetter ifTrue: [f add: c asLowerCase]].
^'abcdefghijklmnopqrstuvwxyz' asArray collect: [:c | f occurrencesOf: c]


The asArray did the trick.  Am I understanding this construct correctly?
Evidently, when a string responds to collect: it insists on building
another string, which cannot--of course--contain integers.  So, using
the asArray, I am "casting" (to use a C term) the string to an array,
so that it responds correctly (for my purposes) to the collect:.  Is this
nearly correct?  If so, Smalltalk can be learned (to the level of getting
something done, as opposed to the level of guru-nicity) *very* quickly!
I just got this thing yesterday, and I have only had a few hours to
play with it, as I am presently constructing a compiler for a class.

As an historical (maybe?) experiment, I am going to try to teach my
computer-phobic parents Smalltalk this summer.  Of course, this sample is
too small to be statistically valid, but it will be interesting!


Wayne Folta          (folta@tove.umd.edu  128.8.128.42)

sa1z+@andrew.cmu.edu (Sudheer Apte) (05/04/89)

folta@tove.umd.edu writes <17280@mimsy.UUCP>:

>   |s f|
>   s := Prompter prompt: 'enter line' default: ''.
>   f := Bag new.
>   s do: [:c | c isLetter ifTrue: [f add: c asLowerCase]].
>   ^f
>...
>The problem is that it *does not* result in an array with the number of
>occurrences, it results in a Bag containing all of the letters.  One more
>step is needed to get the number of occurrences...

Good to hear that your problem was subsequently solved, but I think
this code does indeed return the occurrences of each letter-- though
not in the Pascal-like way of returning an array full of numbers.  A
bag can be considered (and used) as an array indexed by the elements,
so that

	f occurrencesOf: ch

where ch is a character is a ``lookup'' in the array. After
all, how would one be using such an array of occurrences? I think this
*is* the most ``Smalltalk-like'' way of solving the problem!

Thanks,
	Sudheer.
----------------
Sudheer Mukund Apte			sa1z@andrew.cmu.edu
Civil Engineering Department,
Carnegie-Mellon University,		...!harvard!andrew.cmu.edu!sa1z
Pittsburgh, PA 15213
------------------------------------------------------------------------

new@udel.EDU (Darren New) (05/05/89)

In article <17288@mimsy.UUCP> folta@tove.umd.edu.UUCP (Wayne Folta) writes:
>nearly correct?  If so, Smalltalk can be learned (to the level of getting
>something done, as opposed to the level of guru-nicity) *very* quickly!

Yes, it is *nearly* correct. Actually, it is totally correct but inefficient.
Simply send f the asArray message and you should be able to convert the Bag
into an Array. Also, as far as learning Smalltalk, it was designed originally
for the DynaBook, which is what Apple is now pushing at their trade shows
(the notebook with the talking guy in the bowtie and silly stuff like that).
Thus, it was to be accessible, easy to learn, understand, and modify,
and so on. It was also the first implementation of scrollbars and
of windows, and possibly of pop-up menus. Actually, guru-nicity can
be acheived in just a few months (if I do say so myself :-).
Anyway, have fun with it!    -- Darren

jans@tekgvs.LABS.TEK.COM (Jan Steinman) (05/05/89)

<... a program... that counts the occurrences of letters in an input string...>

How about (for Tek Smalltalk, but should be similar in V):

	d _ Dictionary new.
	(FillInTheBlank request: 'enter line') do:
		[:c | d at: c put: (d at: c ifAbsent: [0]) + 1].
	^d

I'd encourage anyone beginning at Smalltalk to play with Dictionary.  People 
who are used to C/Pascal/FORTRAN/BASIC don't think much about key-value pairs, 
although Lispers usually pick up on it quickly.

:::::: Jan Steinman - N7JDB		   Electronic Systems Laboratory ::::::
:::::: jans@tekgvs.LABS.TEK.COM	      Box 500, MS 50-370 (w)503/627-5881 ::::::
:::::: jsteinma@caip.RUTGERS.EDU     Beaverton, OR 97077 (h)503/657-7703 ::::::

dclaar@hpcupt1.HP.COM (Doug Claar) (06/23/89)

A quick review of smalltalk(s) for the PC:

Smalltalk/V, is (as far as I know) the only reasonably priced Smalltalk
for the PC.
It comes in two flavors: Smalltalk/V, which runs on all PCs, and 
Smalltalk/V286, which of course requires a 286 or 386. V is about $99,
V286 is about $199. Of course, the 286 version is faster, and supposedly
more robust, and the product being given the most attention, but V works.
The book that comes with it will get you started, but is woefully 
inadequate to the more complex stuff. And almost all other books are
based on Smalltalk/80, which may or may not run on the PC, but is 
certainly not "reasonably cheap." (It is the 'real' smalltalk). Smalltalk/V
can give you a pretty good taste, though, and it's fun, unless you're 
4.77mhz. Then, it is real slow. 8mhz feels ok, however.

Good luck, and I'm sure someone will correct me if I'm wrong!

Doug Claar
HP Computer Systems Division
UUCP: mcvax!decvax!hplabs!hpda!dclaar -or- ucbvax!hpda!dclaar
ARPA: dclaar%hpda@hplabs.HP.COM

Personal to Charles Noren: I couldn't get this through email to
you, so I posted it here.

madany@m.cs.uiuc.edu (06/24/89)

>> The book that comes with it will get you started, but is woefully 
>> inadequate to the more complex stuff. 

The Smalltalk/V book is an excellent introduction to Smalltalk.
It is also extremely well organized. 
The Smalltalk-80 books I've seen are poorly organized by comparison.

Nevertheless, Smalltalk/V is not exactly the same as Smalltalk-80 and
the book is small, so it cannot cover the advanced topics in detail.

-peter madany

mario@r3.cs.man.ac.uk (06/27/89)

In <7030002@hpcupt1.HP.COM> Doug Claar writes:
>Smalltalk/V, is (as far as I know) the only reasonably priced Smalltalk
>for the PC.
>...
> ...Smalltalk/80, which may or may not run on the PC, but is 
> certainly not "reasonably cheap." (It is the 'real' smalltalk). 

Maybe true a while ago, but not any more...  If you have a 386 PC, you
can run Smalltalk-80 VI2.4 on it.  I have used this on a Compaq
Deskpro 386/20, and it's *wonderful*.

Price: approx $150.  Speed: 170 on the usual scale (where Dorado=100).
This means it's faster than Smalltalk-80 on a Sun 3/60.
Reliability: excellent.  It has a generation-based garbage collector
which is imperceptible, and reclaims cycles.  

Most importantly, it's The Real Thing.  Browsers with categories and
message protocols, correction, mutation of instance variables when you
modify a class definition, multi-processing, and, much, much more..

The only drawback of this as against a Sun is that the screen is
small...and I even have that sorted (with a goodie that lets the real
screen pan over a large "virtual" screen.)  More information can be
obtained from info@parcplace.com.

"(FileStream fileNamed: 'StandardDisclaimer.st') fileIn."

Mario Wolczko
   ______      Dept. of Computer Science    Internet:   mario@ux.cs.man.ac.uk
 /~      ~\    The University               USENET: mcvax!ukc!man.cs.ux!mario
(    __    )   Manchester M13 9PL           JANET:      mario@uk.ac.man.cs.ux
 `-':  :`-'    U.K.                         Tel: +44-61-275 6146  (FAX: 6280)
____;  ;_____________the mushroom project____________________________________

pnm@goanna.cs.rmit.oz.au (Paul BIG-EARS Menon) (04/17/91)

hi,
    Anyone out there use Smalltalk (ParcPlace) on a Mac to access GemStone
    on Unix?  My query is specific to the network requirements - ie, how
    is the connection achieved (achievable)? RS-232 or ethernet? 
    (TCP/IP - Ethertalk, whatever).  I'd appreciate any info.  Please mail
    as well if you post a reply - I may miss it otherwise.

Thankyou,

    Paul Menon,
    Dept of Computer Science,
    Royal Melbourne Institute of Technology, 
    124 Latrobe Street,
    Melbourne 3001, 
    Victoria, Australia.

pnm@goanna.cs.rmit.oz.au
PH:	+61 3 660 3209

euagul@eua.ericsson.se (Ann Gulbrandsen) (04/18/91)

pnm@goanna.cs.rmit.oz.au (Paul BIG-EARS Menon) writes:


>hi,
>    Anyone out there use Smalltalk (ParcPlace) on a Mac to access GemStone
>    on Unix?  My query is specific to the network requirements - ie, how
>    is the connection achieved (achievable)? RS-232 or ethernet? 
>    (TCP/IP - Ethertalk, whatever).  I'd appreciate any info.  Please mail
>    as well if you post a reply - I may miss it otherwise.

>Thankyou,

>    Paul Menon,
>    Dept of Computer Science,
>    Royal Melbourne Institute of Technology, 
>    124 Latrobe Street,
>    Melbourne 3001, 
>    Victoria, Australia.

>pnm@goanna.cs.rmit.oz.au
>PH:	+61 3 660 3209

Hi,

I would also like to get this type of information.

Best regards,

   Ann Gulbrandsen, Ellemtel, Sweden

   email: ann.gulbrandsen@eua.ericsson.se