[toronto-lisp] Factor notes, and website discussion

Vishvajit Singh vishvajitsingh at gmail.com
Mon Feb 9 03:54:18 UTC 2009


Hi everyone,

I've attached the notes from my Factor presentation last week, along
with some of the code I demonstrated. I'm new at giving this kind of
presentation, so it was a learning experience for me. I think that the
live presentation I gave (actual coding, mistakes and all) worked a
lot better than a PowerPoint-style one would have. I hope to give more
presentations in the future.

This stuff really ought to go on a website. Let's set up a Toronto
Lisp website for tutorials, code snippets, meeting minutes, project
collaboration, and so on. I believe someone said they already had a
domain name registered, which is great. How about we set up a Wiki at
first, and see where it goes?

Vish Singh
-------------- next part --------------
Factor presentation to the Toronto Lisp Users' Group - Tuesday, February 3, 2009

- Introduction
- Show the basics of FORTH (slide)
- Factor: like FORTH, but modern, compiled, lots of libraries, fun to play with
- Launch Factor, demonstrate use of stack
    - push 2, 3, "bob"
- Demonstrate basic operations
	- +, *
	- length
- Demonstrate stack manipulators
	- swap, drop, dup, over, rot
- Demonstrate quotations
    - [ 1 + ]
    - call
- Demonstrate if
	- booleans
	- 2 0 > [ "greater" print ] [ "lesser" print ] if
	- demonstrate defining a word for the above operation, check-number
- Demonstrate ctrl-shift-h
- Show the binary tree example (slide)
- Show the code, and demonstrate, the time server example

-------------- next part --------------
                                         Factor presentation
                                            By Vish Singh
                                         -------------------

The basic idea of FORTH:

Prefix:     f(x, y, z) = + x * y z                                  (defun f (x y z)
                                                                        (+ x (* y z)))

Infix:      f(x, y, z) = x + y * z


Postfix:    f(x, y, z) = x y z * +


And in FORTH..

: f * + ;

DEFINE the word f as the concatenation of the two words * and +.

We assume the user has put x, y, and z on the stack before calling f.
The effect of f is to remove x, y, and z, and leave only the result of the computation.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: Factor-slide2.factor
Type: application/octet-stream
Size: 947 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/toronto-lisp/attachments/20090208/8e40921b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: time-server.factor
Type: application/octet-stream
Size: 521 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/toronto-lisp/attachments/20090208/8e40921b/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fun.factor
Type: application/octet-stream
Size: 1282 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/toronto-lisp/attachments/20090208/8e40921b/attachment-0002.obj>


More information about the toronto-lisp mailing list