branch : pmacs2
This commit is contained in:
moculus 2009-03-04 06:53:26 +00:00
parent 74faeb4320
commit 26b58a5c71
2 changed files with 112 additions and 102 deletions

View File

@ -50,7 +50,6 @@
;;; takes two sorted lists a and b and smashes their cdr fields to form a
;;; single sorted list including the elements of both.
;;; Note: this does _not_ accept vectors.
(define (merge! a b less?)
(define (loop r a b)
(if (less? (car b) (car a))
@ -80,13 +79,11 @@
a)))
;;; (sort! sequence less?)
;;; sorts the list or vector sequence destructively. It uses a version
;;; of merge-sort invented, to the best of my knowledge, by David H. D.
;;; Warren, and first used in the DEC-10 Prolog system. R. A. O'Keefe
;;; adapted it to work destructively in Scheme.
(define (sort! seq less?)
(define (step n)
(cond

View File

@ -37,6 +37,19 @@ class SchemeCheckSyntax(method.Method):
else:
app.data_buffer("*Scheme-Check-Syntax*", output)
class GuileStart(method.shell.Interact):
args = []
def _execute(self, w, **vargs):
method.shell.Interact._execute(self, w, bname='*Guile*', cmd='guile')
class GuileLoadFile(method.shell.Interact):
args = []
def _execute(self, w, **vargs):
method.shell.Interact._execute(self, w, bname='*Guile*', cmd='guile')
b = w.application.get_buffer_by_name('*Guile*')
path = os.path.realpath(w.buffer.path)
b.pipe_write('(load "%s")\n' % path)
class Scheme(mode.Fundamental):
modename = 'Scheme'
extensions = ['.scm']
@ -54,7 +67,7 @@ class Scheme(mode.Fundamental):
'scheme_boolean': ('magenta', 'default', 'bold'),
'scheme_number': ('default', 'default', 'bold'),
}
actions = [SchemeCheckSyntax]
actions = [SchemeCheckSyntax, GuileStart, GuileLoadFile]
_bindings = {
'close-paren': (')',),
'close-brace': ('}',),