mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
Define top-level bindings for aux syntax: else, =>, _, ...
* module/ice-9/boot-9.scm (else, =>, ..., _): New definitions. These are specified by the r6rs and the r7rs. * module/ice-9/sandbox.scm (core-bindings): Include the aux syntax definitions. * module/rnrs/base.scm: * module/rnrs.scm: Re-export aux syntax.
This commit is contained in:
parent
4e89d0c061
commit
374c1e5807
4 changed files with 21 additions and 4 deletions
|
@ -416,6 +416,22 @@ If returning early, return the return value of F."
|
|||
(define-syntax-rule (unless test stmt stmt* ...)
|
||||
(if (not test) (begin stmt stmt* ...)))
|
||||
|
||||
(define-syntax else
|
||||
(lambda (x)
|
||||
(syntax-violation 'else "bad use of 'else' syntactic keyword" x x)))
|
||||
|
||||
(define-syntax =>
|
||||
(lambda (x)
|
||||
(syntax-violation '=> "bad use of '=>' syntactic keyword" x x)))
|
||||
|
||||
(define-syntax ...
|
||||
(lambda (x)
|
||||
(syntax-violation '... "bad use of '...' syntactic keyword" x x)))
|
||||
|
||||
(define-syntax _
|
||||
(lambda (x)
|
||||
(syntax-violation '_ "bad use of '_' syntactic keyword" x x)))
|
||||
|
||||
(define-syntax cond
|
||||
(lambda (whole-expr)
|
||||
(define (fold f seed xs)
|
||||
|
|
|
@ -314,6 +314,7 @@ allocation limit is exceeded, an exception will be thrown to the
|
|||
;;
|
||||
(define core-bindings
|
||||
'(((guile)
|
||||
else => _ ...
|
||||
and
|
||||
begin
|
||||
apply
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; rnrs.scm --- The R6RS composite library
|
||||
|
||||
;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2010, 2011, 2019 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
|
||||
|
@ -73,7 +73,7 @@
|
|||
vector-map vector-for-each error assertion-violation assert
|
||||
call-with-current-continuation call/cc call-with-values dynamic-wind
|
||||
values apply quasiquote unquote unquote-splicing let-syntax
|
||||
letrec-syntax syntax-rules identifier-syntax
|
||||
letrec-syntax syntax-rules identifier-syntax else => _ ...
|
||||
|
||||
;; (rnrs bytevectors)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; base.scm --- The R6RS base library
|
||||
|
||||
;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2010, 2011, 2019 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
|
||||
|
@ -23,7 +23,7 @@
|
|||
define define-syntax syntax-rules lambda let let* let-values
|
||||
let*-values letrec letrec* begin
|
||||
|
||||
quote lambda if set! cond case
|
||||
quote lambda if set! cond case else => _ ...
|
||||
|
||||
or and not
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue