Newbie squeak question

Alan Lovejoy sourcery at pacbell.net
Sat Jul 3 00:35:32 UTC 1999


Jeff Carr wrote:

>  I am trying to use a file from Dr. Dobbs Journal to view X.509 certs
>  (x509.st) -- it can be found on their web page.  This is from the class
>  X509CertificateBrowser.
>
>  open
>          "Open a view of an instance of me on the default directory."
>          "X509CertificateBrowser open"
>  [snip]

The code that must be executed to launch the certificate browser is
included in a comment at the beginning of the method named #open.
Specifically: "X509CertificateBrowser open ". The < " > character is
the Smalltalk comment delimiter. Putting startup/test/example-usage
code in a comment at the beginning of key methods is standard practice
in the Smalltalk community.

Any syntactically valid Smalltalk statement, or series of such statements,
can be executed simply by selecting the text of the statement (or series
of statements) with the mouse, bringing up the "operate menu" (generally,
by clicking on the middle mouse button, or else the right mouse button
while simultaneously holding down the control key), and selecting one
of "do It," "inspect It" or "print It" from the menu.  Most text panes in
a Smalltalk system have such a menu (some, which are specifically
intended to be used solely by end users of an application, and not
by programmers, will either have no operate menu, or will not have
programmer-specific options on the menu).  The mouse cursor must
be within the visible bounds of a pane in order to get the operate
menu associated with that pane.

Usually, Smalltalk text pane controllers will select all text between
bracketing delimeters (e.g., parens, braces, brackets, string quotes,
comment quotes, etc) if the user double clicks immediately to the right
of the leftmost delimiter (or immediately to the left of the rightmost
delimiter).  This is extremely useful, and the lack of this behavior
in most other systems is always irritating, at least to me.

Note that if the comment delimiters are included in the selected text,
anything they delimit will be ignored when "do It" is selected from
the operate menu.

You might like to try evaluating some of the following statements,
using either the "print It" or "inspect It" menu options (first copy the
text below into a Squeak text pane):

3 + 4.

Time now.

Date today.

(1 to: 100 by: 2) asSortedCollection: [:a :b | a > b].

Text fromUser.

nil confirm: 'Is anyone there?'.

Compiler evaluate: '3 + 4'.

Compiler evaluate: Text fromUser.

Form toothpaste: 30.  "After selecting 'do It,' hold the left mouse button down
                                 and drag the cursor around the screen."

--Alan

Content-Type: text/x-vcard; charset=us-ascii;
  name="sourcery.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Alan Lovejoy
Content-Disposition: attachment;
  filename="sourcery.vcf"

Attachment converted: Anon:sourcery.vcf 6 (TEXT/R*ch) (0000AD77)





More information about the Squeak-dev mailing list