My homepage | Alma | Jtk | Slaf | Icons

Connect & Work Partner
Foo

foo 0.08

Icône


Interpréteur OO
Last modified : 2001-12-18
Created : 2000-08-08
Author : Guillaume Desnoix ©2000-2001

Français

Nouveau


18-dec-01: Version 0.08.
14-mar-01: Version 0.06. URLS, regular expressions, ...
31-oct-00: First public release.

Presentation

Foo is a "new" language, and its interpreter. The main caracteristics are:

It will be usefull to write small scripts and to build quickly a prototype, and it can be easily embedded inside any application.

This software will be used mainly by developers to conceive a prototype and to test an application, and by users to add functionalities to an application.

Present release

The present release is written in Java. It needs JDK 1.1 or later.

Example

The syntax is similar to Lisp, but the message is in second position.

; Define factorial
; The method is defined for integers and is noted "!"
(&fix message !
      ()
      (self select
	    (0 1)
	    (1 1)
	    (default (self * ((self - 1) !)))))

; Affichage de 9!
(? ? (9 !))

Extract links from a web page

URLs are natively reconized. Regular expressions are available.

; Get the page
('b = (http://localhost/ >>))
; Extract the links
(((b string) ~i "HREF=\"([^\"]*)\"") each s (? . (s cadr)))

A simple rot13

Read the standard input and convert it (rot13) using intervalles

(&byte message rot13 ()
      ('self = (self int))
      ((((65 .. 78) contains self) if (self + 13)
	(((79 .. 90) contains self) if (self - 13)
	 (((97 .. 110) contains self) if (self + 13)
	  (((111 .. 122) contains self) if (self - 13)
	   self)))) byte))
	
(? . ((((:input ->) map 'rot13) convert byte) string))

Documentation

No documentation right now.

How to use it

On the command line

License

The distributions from 0.01 to 0.06 are available under the terms of the GPL2 (GNU General Public License 2). You should read it there.

Download

Sources

Executable



Ring
Million Dollar Icons, San Francisco SF, shanghai, Barxu, , ...