**** Bottle - Jolt Workspace **** Bottle is a tiny tool like Smalltalk Workspace for fonc jolt. ;;; Commands Shift + Cursor key : Select a region. M-p (alt + P) : Eval and print selected expression. M-r : Restart. M-s : Save the text. C-f, C-b, C-p, C-n, C-SPC, C-g : emacs style keys. M-w : copy , C-w : cut , C-y : paste , C-k : killLine C-z, M-/ : undo ;;; Examples (+ 3 4) (bad thing) ;;; Factorial function (define factorial (lambda (x) (if (== x 0) 1 (* x (factorial (- x 1)))))) (factorial 10) ;;; Fibonacci function (define fib (lambda (n) (if (== n 0) 1 (if (== n 1) 1 (+ (fib (- n 1)) (fib (- n 2))))))) (fib 10) ;;; Editor control ; [editor save] [editor load: '"lib/bottle.k"] [editor fontSize: '30 ] ;;; Add a method [[editor _vtable] methodAt: 'foo put: (lambda () (printf "Boo!\n") 0) with: 0] [editor foo] ;;; A graphic demo (define Joe (import "Joe")) [Joe inspect] [Joe browse] [Joe translateBy: ['10, '10]] [Joe scaleBy: ['5, '5]] [Joe rotateBy: ['1 / '10]] [Joe scaleBy: [['1 / '10], ['1 / '10]]] [editor load: '"lib/tennis.js"]