mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-08 22:50:27 +02:00
reformat comments
* module/language/elisp/bindings.scm: * module/language/elisp/compile-tree-il.scm: * module/language/elisp/lexer.scm: * module/language/elisp/parser.scm: * module/language/elisp/runtime.scm: * module/language/elisp/runtime/function-slot.scm: * module/language/elisp/runtime/macro-slot.scm: * module/language/elisp/runtime/value-slot.scm: Reformat comments.
This commit is contained in:
parent
372b11fc73
commit
27b9476a8d
8 changed files with 478 additions and 450 deletions
|
@ -2,32 +2,34 @@
|
|||
|
||||
;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
;;;
|
||||
;;; This library is free software; you can redistribute it and/or
|
||||
;;; modify it under the terms of the GNU Lesser General Public
|
||||
;;; License as published by the Free Software Foundation; either
|
||||
;;; version 3 of the License, or (at your option) any later version.
|
||||
;;; This library is free software; you can redistribute it and/or modify
|
||||
;;; it under the terms of the GNU Lesser General Public License as
|
||||
;;; published by the Free Software Foundation; either version 3 of the
|
||||
;;; License, or (at your option) any later version.
|
||||
;;;
|
||||
;;; This library is distributed in the hope that it will be useful,
|
||||
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;;; This library is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;;; Lesser General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU Lesser General Public
|
||||
;;; License along with this library; if not, write to the Free Software
|
||||
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
;;; 02110-1301 USA
|
||||
|
||||
;;; Code:
|
||||
|
||||
(define-module (language elisp runtime macro-slot)
|
||||
#:use-module (language elisp runtime))
|
||||
|
||||
; This module contains the macro definitions of elisp symbols. In contrast to
|
||||
; the other runtime modules, those are used directly during compilation, of
|
||||
; course, so not really in runtime. But I think it fits well to the others
|
||||
; here.
|
||||
;;; This module contains the macro definitions of elisp symbols. In
|
||||
;;; contrast to the other runtime modules, those are used directly
|
||||
;;; during compilation, of course, so not really in runtime. But I think
|
||||
;;; it fits well to the others here.
|
||||
|
||||
; The prog1 and prog2 constructs can easily be defined as macros using progn
|
||||
; and some lexical-let's to save the intermediate value to return at the end.
|
||||
;;; The prog1 and prog2 constructs can easily be defined as macros using
|
||||
;;; progn and some lexical-let's to save the intermediate value to
|
||||
;;; return at the end.
|
||||
|
||||
(built-in-macro prog1
|
||||
(lambda (form1 . rest)
|
||||
|
@ -41,7 +43,7 @@
|
|||
(lambda (form1 form2 . rest)
|
||||
`(progn ,form1 (prog1 ,form2 ,@rest))))
|
||||
|
||||
; Define the conditionals when and unless as macros.
|
||||
;;; Define the conditionals when and unless as macros.
|
||||
|
||||
(built-in-macro when
|
||||
(lambda (condition . thens)
|
||||
|
@ -51,9 +53,10 @@
|
|||
(lambda (condition . elses)
|
||||
`(if ,condition nil (progn ,@elses))))
|
||||
|
||||
; Impement the cond form as nested if's. A special case is a (condition)
|
||||
; subform, in which case we need to return the condition itself if it is true
|
||||
; and thus save it in a local variable before testing it.
|
||||
;;; Impement the cond form as nested if's. A special case is a
|
||||
;;; (condition) subform, in which case we need to return the condition
|
||||
;;; itself if it is true and thus save it in a local variable before
|
||||
;;; testing it.
|
||||
|
||||
(built-in-macro cond
|
||||
(lambda (. clauses)
|
||||
|
@ -77,7 +80,7 @@
|
|||
(progn ,@(cdr cur))
|
||||
,rest))))))))
|
||||
|
||||
; The and and or forms can also be easily defined with macros.
|
||||
;;; The and and or forms can also be easily defined with macros.
|
||||
|
||||
(built-in-macro and
|
||||
(case-lambda
|
||||
|
@ -107,7 +110,7 @@
|
|||
,var
|
||||
,(iterate (car tail) (cdr tail)))))))))))
|
||||
|
||||
; Define the dotimes and dolist iteration macros.
|
||||
;;; Define the dotimes and dolist iteration macros.
|
||||
|
||||
(built-in-macro dotimes
|
||||
(lambda (args . body)
|
||||
|
@ -150,15 +153,15 @@
|
|||
(list (caddr args))
|
||||
'())))))))))
|
||||
|
||||
; Exception handling. unwind-protect and catch are implemented as macros (throw
|
||||
; is a built-in function).
|
||||
;;; Exception handling. unwind-protect and catch are implemented as
|
||||
;;; macros (throw is a built-in function).
|
||||
|
||||
; catch and throw can mainly be implemented directly using Guile's
|
||||
; primitives for exceptions, the only difficulty is that the keys used
|
||||
; within Guile must be symbols, while elisp allows any value and checks
|
||||
; for matches using eq (eq?). We handle this by using always #t as key
|
||||
; for the Guile primitives and check for matches inside the handler; if
|
||||
; the elisp keys are not eq?, we rethrow the exception.
|
||||
;;; catch and throw can mainly be implemented directly using Guile's
|
||||
;;; primitives for exceptions, the only difficulty is that the keys used
|
||||
;;; within Guile must be symbols, while elisp allows any value and
|
||||
;;; checks for matches using eq (eq?). We handle this by using always #t
|
||||
;;; as key for the Guile primitives and check for matches inside the
|
||||
;;; handler; if the elisp keys are not eq?, we rethrow the exception.
|
||||
|
||||
(built-in-macro catch
|
||||
(lambda (tag . body)
|
||||
|
@ -180,8 +183,8 @@
|
|||
((guile-primitive throw) ,dummy-key ,elisp-key
|
||||
,value))))))))))
|
||||
|
||||
; unwind-protect is just some weaker construct as dynamic-wind, so
|
||||
; straight-forward to implement.
|
||||
;;; unwind-protect is just some weaker construct as dynamic-wind, so
|
||||
;;; straight-forward to implement.
|
||||
|
||||
(built-in-macro unwind-protect
|
||||
(lambda (body . clean-ups)
|
||||
|
@ -192,7 +195,7 @@
|
|||
(lambda () ,body)
|
||||
(lambda () ,@clean-ups))))
|
||||
|
||||
; Pop off the first element from a list or push one to it.
|
||||
;;; Pop off the first element from a list or push one to it.
|
||||
|
||||
(built-in-macro pop
|
||||
(lambda (list-name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue