Question 1. What Is Smalltalk?
Smalltalk is pure object oriented programming (OOPs), dynamically typed and reflective programming language.
Smalltalk is an improvement environment – class browsers, debugger, inspector and refactoring engine.
Everything is an object –variables, constants, activation records and classes.
Smalltalk was designed and created by Learning Research Group of Xerox PARC in 1972 and the Researcher Team –
- Alan Kay
- Dan Ingalls
- Adele Goldberg
- Ted Kaehler
- Scott Wallace
- And so on
All computation is performed by objects sending and receiving messages – 1+2*3
Question 2. What Types Of Characters Allowable In Smalltalk?
- blank, tab, cr, ff, lf
- And so on
Question 3. How To Declare Variables In Smalltalk?
- Variables must be declared before use
- Shared variables must begin with uppercase
- Local variables must begin with lowercase
- Reserved names – true, false, nil, self and super
Question 4. What Is The Variable Scope In Smalltalk?
- Class Instance
- Block Temporary
- Method Temporary
- Method Parameters
- Instance Variables
Question 5. What Is “the Smalltalk For Those Who Can Type” Supposed To Mean?
It is a pun on the usage of a text editor (and thus using the keyboard more, and the mouse less) to write programs for GNU Smalltalk, which sets it different from other Smalltalk.
Question 6. How Stable Is Gnu Smalltalk? How Scalable? How Fast?
It is quite stable. There are bugs for sure in the virtual machine, but unless you’re unlucky you shouldn’t be affected. This is especially true for the stable branch, where only changes to improve stability are made; development releases are by their very nature less stable.
It is quite scalable, even though the garbage collector performs worse once you have more than 150-200 MB of live data. Very long strings also do not perform as well as they could. In general, object-orientation makes it easier to pick good data structures (such as streams).
It is quite fast. While GNU Smalltalk has an experimental just-in-time compiler, even the bytecode interpreter should be faster than most other scripting languages. However, GNU Smalltalk’s base classes are written entirely in Smalltalk (unlike Python or Lua, for example). While this gives more flexibility to the programmer, programs that heavily use dictionaries may run slower than the equivalent programs in other languages.
Question 7. Where’s The Gui?
GNU Smalltalk does not by default start a full-blown integrated development environment.
However, one is available and can be started with this command:
The latest git versions include a new IDE, called VisualGST,
that can be started with this command instead:
Question 8. What Is Cool About Smalltalk?
Smalltalk is an object-oriented programming language with a uniform programming model. Unlike many other languages, learning the Smalltalk programming language is easy because there are just a few concepts to grasp. Everything is an object in Smalltalk (including number, string, character, code blocks, and classes themselves), and everything is done through a single paradigm, that of sending messages from one object to another.
Many cool and revolutionary ideas were conceived from the Smalltalk community, including the very idea of window-based, graphical user interfaces. Smalltalk systems are open, as source code for every class is available and modifiable, including all the kernel classes; being free software, GNU Smalltalk extends this openness to the virtual machine, and complements it with the freedom to redistribute and publish your improvements.
Question 9. What Else Is Cool About Gnu Smalltalk?
First of all, it is free software. This means that you can play with it and understand how it works, break it and understand why it broke, fix it and enjoy having fixed it.
Compared to other Smalltalk implementations, GNU Smalltalk is very different in one aspect: it is pragmatically designed to be a tool rather than an environment. It complements other tools that you use in your daily work, without any pretense of completely replacing them. This also provides a smoother learning curve for people who know other scripting languages such as Python or Ruby.
Question 10. What Is A Generator?
A generator is a quick way to create a Stream. As you might have seen in an earlier question, streams are a powerful iteration tool that Smalltalk offers. A generator is a kind of pluggable stream, in that a user-supplied blocks defines which values are in a stream.
For example, here is an empty generator and two infinite generators:
Generator on: [ :gen | ]
Generator on: [ :gen | [ gen yield: 1 ] repeat ]
Generator inject: 1 into: [ :value | value + 1 ]
As a more concrete example, these lines process a file and create Person objects out of the file:
lines := file lines.
lines := lines select: [ :line | line ~ ‘^[A-Za-z]+ [0-9]+$’ ].
fields := lines collect: [ :line | line subStrings ].
people := fields collect: [ :data |
Person name: data first age: data second asInteger ].
Let’s see how to rewrite them to use a single Generator instead:
Generator on: [ :gen |
file linesDo: [ :line || data |
line ~ ‘^[A-Za-z]+ [0-9]+$’ ifTrue: [
data := line subStrings.
gen yield: (Person name: data first age: data second asInteger) ] ] ].
As you can see, #select: becomes an if-statement, and the value from the final stream is yielded to the user of the generator.
Generators use continuations, but they shield the users from their complexity by presenting the same simple interface as streams.
Question 11. What Is Vfs?
VFS is GNU Smalltalk’s Virtual FileSystem layer. VFS allows GNU Smalltalk programs to use archive files (.gz, .tar, .zip, etc.) and URLs transparently. The first implementation of VFS was inspired by the homonymous feature of the Midnight Commander, later incorporated in GNOME and now called GVFS.
VFS is a fundamental part of the implementation of .star packages.
Question 12. Does Gnu Smalltalk Support Unicode And Mbcs?
Yes. Strings however are processed (e.g. read from a file) byte-per-byte. If you need per-character processing, you should load the Iconv package and convert strings to UnicodeString, using the #asUnicodeString method.
Python Interview Questions
Adv Java Interview Questions
Adv Java Tutorial
VBScript Advanced Interview Questions
Basic Programming Interview Questions
D Programming Language Tutorial
Ruby Interview Questions
Python Interview Questions