[ | smalltalk dot org ].
Community and industry meet inventing the future.
Some Basic F-Script Examples
posted by Peter William Lount
version 1, 20040920 12:30pm PDT

Get the names of the employees:
Smalltalk:
employees collect:[:anEmployee | anEmployee name]

F-Script:
employees name

Get the names of the employees whose age is greater than 30:
Smalltalk:
(employees select:[: anEmployee | anEmployee age > 30]) collect:[: anEmployee | anEmployee name]

F-Script:
employees name at: employees age > 30

Get a list of employees sorted according to their salary:
Smalltalk:
employees asSortedCollection:[:e1 :e2| e1 salary < e2 salary]

F-Script:
employees at: employees salary sort

Increase the salary of each employee by a specific amount:
Smalltalk:
employees with:amounts do:[:anEmployee :anAmount| anEmployee raiseSalary:anAmount]

F-Script:
employees raiseSalary:amounts



Copyright 1999-2010 by Smalltalk.org™, All Rights Reserved.
Thursday
September 02 2010
Travel Adventure

Costa Rica

El Salvador

Guatemala

Honduras

Panama

Enjoy a tropical vacation in the sun, surf, in the jungle for adventure, yoga and massage for relaxation or learn the culture, history and langauge. Visit, live, work, play, retire. Enjoy.

Central America
Interoperate.org, the place to find out how to interoperate.
Google
Web
Smalltalk.org

64bits.net AMD64, Intel Pentium EM64T, Intel Itanium
Meet other Smalltalk people, contribute, learn, earn.
lingoize.me
On speaking languages
naturally with ease
aiming for fluid fluency.