
WAAlphabeticBatchedList efetua a paginação de uma lista de forma alfabética.
Para testar crie a classe com o código:
WAComponent subclass: #AlphabeticBatchedListHack
instanceVariableNames: ‘items batchedlist’
classVariableNames: ”
poolDictionaries: ”
category: ‘Seaside-Hacks’
Os métodos são:
initialize
super initialize.
items := Collection allSubclasses..
batchedlist := WAAlphabeticBatchedList new.
batchedlist items: items
renderContentOn: html
html heading: self class description.
html heading: ‘All subclasses of Collection’ level: 2.
batchedlist batch
do: [:item | html render: item. html break].
html render: batchedlist
children
^ Array with: batchedlist
A página apresentada é como abaixo:

Categorias: Smalltalk
Etiquetado: hack, Seaside
Neste hack colocamos alguns códigos que podem esclarecer como usar o componente WABatchedList no Seaside. Primeiro crie a classe de teste com:
WAComponent subclass: #BatchedListHack
instanceVariableNames: ‘items batchedlist’
classVariableNames: ”
poolDictionaries: ”
category: ‘Seaside-Hacks’
Depois implemente os seguintes métodos:
initialize
super initialize.
items := OrderedCollection new.
1
to: 100
do: [:k | items add: 'item ' , (k asString padded: #left to: 3 with: $0)].
batchedlist := WABatchedList new.
batchedlist batchSize: 15.
batchedlist items: items
renderContentOn: html
html heading: ‘Batched List Test’.
batchedlist batch
do: [:item |
html render: item.
html break].
html render: batchedlist
children
^ Array with: batchedlist
A página gerada é como abaixo:

Categorias: Smalltalk
Etiquetado: hack, Seaside

“Smalltalk is dangerous. It is a drug. My advice to you would be don’t try it; it could ruin your life. Once you take the time to learn it (to REALLY learn it) you will see that there is nothing out there (yet) to touch it. Of course, like all drugs, how dangerous it is depends on your character. It may be that once you’ve got to this stage you’ll find it difficult (if not impossible) to “go back” to other languages and, if you are forced to, you might become an embittered character constantly muttering ascerbic comments under your breath. Who knows, you may even have to quit the software industry altogether because nothing else lives up to your new expectations.”
Andy Bower
Fonte: Seaside, ROR and retiring Java from the spotlight of web applications
Categorias: Smalltalk · Software · Tecnologia

Um quine em Smalltalk:
| prog quote |
quote := Character value: 39.
prog := '| prog quote |
quote := Character value: 39.
prog := .
Transcript show: (prog copyFrom: 1 to: 53).
Transcript show: quote asString; show: prog; show: quote asString.
Transcript show: (prog copyFrom: 54 to: 212).
'.
Transcript show: (prog copyFrom: 1 to: 53).
Transcript show: quote asString; show: prog; show: quote asString.
Transcript show: (prog copyFrom: 54 to: 212).
Fonte: http://www.nyx.net/~gthompso/self_smalltalk.txt
Links relacionados:
Categorias: Smalltalk
Etiquetado: quine

- Seaside dandelionOutput
- Dandelion
- Dandelion is a generic Smalltalk code analysis/output framework. You can analyze your code and output the information in various formats (currently HTML, SMIX, Petal, XMI).Dandelion looks like a “doclet” in Smalltalk. And the impression is 80% right. However, I believe Dandelion has more flexibility. You can customize not only outputting format, but also analysis policy(what/how code elements will be analyzed) and analyzed information storage(how the analysis information is stored).
Categorias: Smalltalk
Etiquetado: Seaside

Há alguns anos, inspirado no programa Geometer Sketchpad (por sua vez inspirado no programa Cabri Géomètre) comecei a fazer um similar em Object Pascal (Delphi). Recentemente encontrei uma implementação open source muito boa em Squeak: o Dr Geo II, um programa para experimentação dinâmica com geometria. Brinquei um pouco com ele e gostei bastante (Clique na imagem abaixo para ampliá-la).

Links relacionados:
Categorias: Matemática · Smalltalk · Software