Re: Learning to program sawfish

* Rafal Kolanski [2008-09-03 07:53+0200] writes:

> Unfortunately, I know very little lisp. If I were to look at a lisp
> tutorial, which lisp is rep closest to?

Emacs and Scheme48 are the most obvious inspirations for REP.  Emacs has
excellent documentation and tutorials, for users and programmers.  You
wont find much information about mechanisms like hooks, plists, or
docstrings in a Scheme tutorial.  OTOH, you wont find anything about
modules in the ELisp manual.

If you can't find a dedicated REP/Sawfish tutorial, the ELisp tutorial
would be a good way to get you started.

If you have access to a decent library (and too much time :), you may
also look up one of those books:

- The Little Schemer.  This is an effective book to learn list
  manipulation basics and recursion.  Don't let you fool by the unusual
  layout.  It's a very cool book (at least for the simple things).

- SICP.  The classic Scheme book.  But be warned, after reading this
  book, some people think that Scheme is the only Lisp worth

- Peter Norvig's PAIP.  This is the best Lisp book ever written.  This
  shows you how to use Lisp effectively.

> As I'm also learning a little
> bit of emacs hacking ... what are the main differences between rep and
> elisp?

1. in REP, you can't funcall symbols.  A common use of this feature are
hooks.  In ELisp, I usually add symbols to hooks, not closures.
This makes it easier to redefine the function or remove the function
from the hook.

2. the module system.  All functions in REP live in a module (those
loaded from .sawfishrc or typed to the repl are in the "user" module).
This is quite nice, because you can have many namespaces and Sawfish is
split up in small modules.  What I don't understand is how
loading/reloading/unloading are supposed to work.  I usually have to
resort to trial and error.  Hint: you can refer to function FOO in
module BAR by writing BAR#FOO.  This is useful if you just want to call
one or a few functions in another module without pulling in the entire

3. the debugger.  The REP debugger, at least inside Sawfish, is rather
disappointing.  Have you ever called (break) in Sawfish?  Then you know
what I mean :-)  In ELisp it's always safe to call (debug).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]