Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Smalltalk
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Integrated Development Environment== {{urs|date=February 2025}} Smalltalk is one of the first systems to be based around an [[Integrated Development Environment]]. There are a rich variety of tools to support code development, and other activities, such as graphics, and music. Smalltalk was the first system in which the modern desktop paradigm of Windows, Icons, Menus, and Pointers ([[WIMP (computing)|WIMP]]) was created. Although pointers has already been invented, Smalltalk was the first system to implement overlapping windows and pop-up menus. While there are several programming tools we shall describe the following five major tools. The images of the tools are from a 2024 Squeak system * browser, the main code viewing and writing tool * workspace, a text editor in which expressions can be evaluate * transcript, an output window for text, which in many dialects is also a workspace * inspector * notifier/debugger, a window opened in response to an unhandled exception, and can morph into a full debugger === Browser === Smalltalk-80 derived systems organize classes within "system categories", such as <code>Kernel-Numbers</code>, <code>Kernel-Objects</code>, <code>Collections-Abstract</code>, <code>Collections-Sequenceable</code>, etc, and within classes methods are organized in named categories such as <code>accessing</code>, <code>arithmetic</code>, <code>instance creation</code>, etc. From this follows the classic five paned browser, with four panes in the upper half of the window containing from high to left the list of system categories, that when one is selected displays in the second window the list of classes in that category, that when one is selected displays the list of message categories in the selected class, that when one is selected displays in the last pane the selectors of the methods in the selected category in the selected class. When one of the selectors in the fourth pane is selected the source for that method is displayed in the fifth pane. If only a category is selected and not a method, the fifth pane shows a template for defining a new method. If a system category is selected but no class, a template for creating a class in the category is displayed. Various pop-up menus allow one to query the tool such as searching for a class by name, finding all senders of a selected message, or all implementors of the message, and so on. In this way the browser is both a code reading and system exploration tool and a code authoring tool.[[File:Squeak System Browser Fraction.png|thumb|right|Squeak System Browser on Fraction's lcm: method]] === Workspace === A Workspace is a simple text editor editing a single string. One can type arbitrary text in the workspace, including Smalltalk expressions. On the pop-up menu "do it" (evaluate the selected expression), "print it" (evaluate the selected expression and insert the print string of the result immediately after the selection), and "inspect it" (open an inspector on the result of the evaluation of the selected expression, see "Inspector" below) are three oft used actions. Note that the fifth pane in the Browser is also a workspace, so that one can evaluate expressions and insert their results while editing method definitions, and a common thing is to include evalteable expressions, typically examples, in comments in a method, because almost everywhere the text of a method is shown (for example in the debugger) code is executable as in a workspace. Both workspaces and the browser's text panes are typically syntax highlighted. By using blocks to separate different expressions one can have several syntax highlighted expressions, each with their own temporaries in a single workspace. [[File:SqueakWorkspace.png|thumb|right|Workspace]] === Transcript === The Transcript is a special workspace associated with the global Transcript. So evaluating <syntaxhighlight lang="smalltalk" inline>Transcript print: 52 factorial; cr; flush</syntaxhighlight> causes 80658175170943878571660636856403766975289505440883277824000000000000 followed by a newline to appear on the Transcript window. The Transcript therefore serves as a place to emit logging messages, although it can also function as a Workspace === Inspector === There are various inspectors, some tailored to displaying different kinds of object. The most basic inspector has two panes. To the left is a list of the object itself (with the label "self"), followed by the instance variables in the object, which will include numbered instance variables in sequences such as strings and arrays. To the right is a workspace pane. Selecting a name in the list replaces the workspace's contents with a print string of the selected variable. Editing and "accepting" the text in the workspace pane when an instance variable is selected will assign the result of the evaluation to the selected variable. One can "drill down" by using the "inspect" command on the list menu which will apply to the selected instance variable. More sophisticated inspectors (e.g. explorers) support finder-like tree access so that object structure can be traversed without opening additional windows.[[File:Squeak Inspect Rectangle.png|thumb|right|Squeak Inspector on an instance of class Rectangle]] === Notifier/Debugger === The default response to an unhandled exception is to open a Notifier, which is a window containing a stack backtrace of the first few activations, and buttons such as "Debug", "Proceed", "Close", etc. If the programmer chooses "Debug" then the full debugger opens. This has six panes. At the top is the stack window, containing a list of the contexts in the stack. Selecting a context causes the middle pane to display the text of the context's method, and to highlight the current expression within the method. Selecting the top context will display the method raising the exception and the message raising the exception will be highlighted. Selecting a context causes the bottom four panes to be updated. The bottom left two panes are the receiver inspector, that inspect the receiver of the selected message. The bottom right two panes are the context inspector that show the argument and temporary variable names in the selected context and allow display and modification of these variables. Sending the message <code>self halt</code> causes an exception which opens a notifier, providing a simple breakpoint facility (typically breakpoint facilities provide more than just the simple halt, but it was the first such facility). Workspaces also provide a "debug it" evaluator which opens a debugger on the selected expression positioned at the first message send within the expression. So selecting <code>52 factorial</code> and choosing "debug it" from the pop-up menu opens a debugger with the "doit context" selected and the <code>factorial</code> selector highlighted. The debugger provides buttons to do "step into", "step over", etc. Hence by choosing "step into" one can explore the evaluation of <code>52 factorial</code>. In this way the debugger provides an inspector of a process, allowing one to explore a halted computation. If an exception results from a doesNotUnderstand:, or subclassResponsibility send, then the notifier will include a "Create" button, allowing the programmer to choose where in the receiver's hierarchy to define an "initial draft" of the method to be implemented. Redefining a method in the debugger causes the selected context to reset back to the first statement (arguments are not modifiable in Smalltalk so this gets the execution state back to the start of a method). In this way the debugger supports live programming, defining methods as the computation proceeds. This is an extremely productive and enjoyable way to program. Everything in the system is at your finger tips. One has the full power of workspaces to evaluate subexpressions, and the browser to search for supporting code as one programs. [[File:Squeak MNU demonstrate programmingIn.png|thumb|right|Squeak Notifier for #demonstrate:programmingIn: MessageNotUnderstood error]] Clicking on the Debug button opens the Notifier into a Debugger allowing inspecting the call stack and editing and continuing from any method activation. In this case the Notifier has created a template of the missing method that the programmer can edit, compile, and then continue the computation. [[File:Squeak Debugger Define demonstrate-programmingIn-.png|thumb|right|Squeak Debugger showing live programming in the debugger]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)