The following example demonstrates the console environment's interactive functionality. In the example, the user starts console-dylan in interactive mode, opens the playground project, performs some arithmetic, defines a method, and then traces it:
MS-DOS> console-dylan
Functional Developer(TM) ...
Version ...
Copyright (c) 1999-2000, Functional Objects, Inc.
All rights reserved.
> :play
Opened project dylan-playground
Starting: dylan-playground
> 1 + 2;
$0 = 3
> define method factorial (x) if (x < 2) 1 else x * factorial(x - 1) end end;
> factorial(5);
$1 = 120
> :trace factorial
> :set messages verbose
Messages: verbose
> factorial(6);
0: factorial (<object>): (6)
1: factorial (<object>): (5)
2: factorial (<object>): (4)
3: factorial (<object>): (3)
4: factorial (<object>): (2)
5: factorial (<object>): (1)
5: factorial (<object>) => (2)
4: factorial (<object>) => (6)
3: factorial (<object>) => (24)
2: factorial (<object>) => (120)
1: factorial (<object>) => (720)
0: factorial (<object>) => (#[720])
$2 = 720
> :exit
d:\users\dylan\builds>
The commands described in this appendix can also be used in the Command Line window within the regular Functional Developer development environment. Choose File > Command Line... from the main window and use commands at the ? prompt.