|
Smalltalk
Community
Versions
All Versions
Smalltalk Standard Extending Smalltalk Squeak Smalltalk GNU Smalltalk Little Smalltalk Java Smalltalk PDST MicroSeeker PIC/Smalltalk Sharp #Smalltalk Pocket Smalltalk Talks2 Smalltalk F-Script Squat Smalltalk Smalltalk/X StrongTalk Ambrai Smalltalk VisualWorks ObjectStudio VisualAge Smalltalk Dolphin Smalltalk Smalltalk MT S# Smallscript Smalltalk/JVM OOVM Embedded Gemstone/S LSW Vision-Smalltalk Slate Smalltalk Zoku Smalltalk VSE Smalltalk Smalltalk Express Smalltalk/V286 Smalltalk/VMac Smalltalk/V Smalltalk-80 |
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
Articles in the Extending Smalltalk series:
Copyright 1999-2010 by Smalltalk.org, All Rights Reserved. |
September 02 2010 Costa Rica El Salvador Guatemala Honduras Panama Central America
lingoize.me
naturally with ease aiming for fluid fluency. |