[geeks] vi vs. emacs - rational discussion
    Sandwich Maker 
    adh at an.bradford.ma.us
       
    Sat Apr  3 20:00:33 CST 2004
    
    
  
"From: "Jonathan C. Patschke" <jp at celestrion.net>
"
"
"One of the really neat things I like about Emacs is the easy access to a
"lisp interpreter.  Don't want to learn lisp?  Just use it for simple
"things:
"
"  C-x b *scratch*
"  (* 24234 34234)
"  C-j
"
"And Emacs happily replies with 24320388, the product of 24234 and
"34234.  Then you can C-x RET to get back to what you were working on.
"The +, -, /, and % (modulo) arithmetic functions work similarly.
in vi with SH set to ksh:
:!print $((24234*34234))
829626756
something wrong with your elisp math?	[;^>]
"You can even use it to help you decide what you want for lunch:
"
"  (defun pick-x (theList x) (if (= x 0) (car theList)
"                                (pick-x (cdr theList) (- x 1))))
"  (defun pick-random (theList x)
"                     (pick-x theList (abs (% (random) (length theList)))))
"  (setq lunch-options '(burger sub indian mexican chinese))
"  (pick-random lunch-options)
"
"And Emacs says I need Indian food.
#!/usr/bin/ksh -p
set -A theList burger sub indian mexican chinese
lunch-options=$((RANDOM%${theList[*]}))
print "you eat ${theList[$lunch-options]} today"
# end
for a start.
________________________________________________________________________
Andrew Hay                                  the genius nature
internet rambler                            is to see what all have seen
adh at an.bradford.ma.us                       and think what none thought
    
    
More information about the geeks
mailing list