Commit 11f36591 authored by Erick's avatar Erick

NOP

parent 069ca95e
......@@ -102,5 +102,6 @@ State can be one of the following values
? 94 Type-Restricted Numerical Functions
? 95 Sorting and Merging
Y 96 SLIB Prerequisites
Implemented SRFIs: 37/66
Implemented SRFIs: 38/67
......@@ -18,7 +18,7 @@
;; USA.
;; Author: Erick Gallesio [eg@unice.fr]
;; Creation date: 26-Nov-2000 18:19 (eg)
;; Last file update: 13-Dec-2007 12:42 (eg)
;; Last file update: 27-Aug-2008 13:44 (eg)
;;
;; ======================================================================
......@@ -524,6 +524,17 @@ symbol.]))
you need to insert the following expression])
(fontified-code [(require "srfi-89")])
(p [in your code or uses the ,(code "cond-expand") special form.]))
;; ----------------------------------------------------------------------
;; SRFI 96 -- SLIB Prerequisites
;; ----------------------------------------------------------------------
(srfi-section 96
(p [,(quick-link-srfi 96) is fully supported. To use SRFI-96,
you need to insert the following expression])
(fontified-code [(require "srfi-96")])
(p [in your code or uses the ,(code "cond-expand") special form.]))
;; End of chapter
)
......@@ -18,7 +18,7 @@
;; USA.
;; Author: Erick Gallesio [eg@unice.fr]
;; Creation date: 26-Nov-2000 18:19 (eg)
;; Last file update: 9-Dec-2007 20:31 (eg)
;; Last file update: 27-Aug-2008 12:44 (eg)
;;
;; ======================================================================
......@@ -449,6 +449,7 @@ be accessed as a normal port with the standard Scheme primitives.])
(insertdoc 'call-with-input-string)
(insertdoc 'call-with-output-string)
(insertdoc 'output-port?)
(insertdoc 'port?)
(insertdoc 'output-string-port?)
(insertdoc 'output-file-port?)
(insertdoc 'output-virtual-port?)
......
......@@ -2,7 +2,7 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 11-Apr-2000 10:30 (eg)
# Last file update: 13-Dec-2007 12:37 (eg)
# Last file update: 27-Aug-2008 13:43 (eg)
SUBDIRS = Match.d SILex.d Lalr.d ScmPkg.d @LURCDIR@
......@@ -74,6 +74,7 @@ scheme_SRCS = STklos.init \
srfi-69.stk \
srfi-70.stk \
srfi-89.stk \
srfi-96.stk \
tar.stk \
trace.stk
......@@ -113,6 +114,7 @@ scheme_OBJS = compfile.ostk \
srfi-69.ostk \
srfi-70.ostk \
srfi-89.ostk \
srfi-96.ostk \
tar.ostk \
trace.ostk
......
......@@ -18,7 +18,7 @@
#
# Author: Erick Gallesio [eg@unice.fr]
# Creation date: 11-Apr-2000 10:30 (eg)
# Last file update: 13-Dec-2007 12:37 (eg)
# Last file update: 27-Aug-2008 13:43 (eg)
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
......@@ -266,6 +266,7 @@ scheme_SRCS = STklos.init \
srfi-69.stk \
srfi-70.stk \
srfi-89.stk \
srfi-96.stk \
tar.stk \
trace.stk
......@@ -305,6 +306,7 @@ scheme_OBJS = compfile.ostk \
srfi-69.ostk \
srfi-70.ostk \
srfi-89.ostk \
srfi-96.ostk \
tar.ostk \
trace.ostk
......
......@@ -4,7 +4,7 @@
;;;
;;; This code is in the public domain.
;;;
;;; Last file update: 13-Dec-2007 12:38 (eg)
;;; Last file update: 27-Aug-2008 13:41 (eg)
;;;
......@@ -213,7 +213,11 @@
;;; provide ensures that the file "srfi-59" will be not loaded
(provide "srfi-59")
;;@ (FILE-POSITION <port> . <k>)
(define (file-position port . args)
(if (null? args)
(port-current-position port)
(port-seek port (car args) :start)))
;;@ (OUTPUT-PORT-WIDTH <port>)
(define (output-port-width . arg) 79)
......@@ -244,6 +248,9 @@
;;(define (force-output . arg) #t)
(define force-output flush-output-port)
;;; CALL-WITH-INPUT-STRING and CALL-WITH-OUTPUT-STRING are the string
;;; port versions of CALL-WITH-*PUT-FILE.
......@@ -259,7 +266,7 @@
(define char-code-limit 256)
;;@ MOST-POSITIVE-FIXNUM is used in modular.scm
(define most-positive-fixnum #x0FFFFFFF)
(define most-positive-fixnum (greatest-fixnum))
;;@ Return argument
(define (identity x) x)
......@@ -347,13 +354,21 @@
(apply error (format "~A" (car args)) (cdr args))))))
;@
(define (make-exchanger obj)
(lambda (rep) (let ((old obj)) (set! obj rep) old)))
(lambda (rep)
(with-mutex (make-mutex 'make-exchanger)
(lambda ()
(let ((old obj))
(set! obj rep)
old)))))
(define (open-file filename modes)
(case modes
((r rb) (open-input-file filename))
((w wb) (open-output-file filename))
(else (slib:error 'open-file 'mode? modes))))
(define (port? obj) (or (input-port? obj) (output-port? obj)))
(define (call-with-open-ports . ports)
(define proc (car ports))
(cond ((procedure? proc) (set! ports (cdr ports)))
......@@ -372,10 +387,11 @@
;@
(define (browse-url url)
(define (try cmd end) (zero? (system (string-append cmd url end))))
(or (try "netscape-remote -remote 'openURL(" ")'")
(try "netscape -remote 'openURL(" ")'")
(try "netscape '" "'&")
(try "netscape '" "'")))
(or (try (format "~A '" (getenv "BROWSER")) "'&")
(try "firefox-remote -remote 'openURL(" ")'")
(try "firefox -remote 'openURL(" ")'")
(try "firefox '" "'&")
(try "firefox '" "'")))
;;@ define these as appropriate for your system.
(define slib:tab (integer->char 9))
......@@ -416,7 +432,9 @@
;;@ At this point SLIB:LOAD must be able to load SLIB files.
(define slib:load slib:load-source)
(define program-arguments argv)
(define (program-arguments)
(cons (program-name)
(argv)))
(define current-time current-seconds)
......@@ -440,7 +458,9 @@
(let* ((srfi-name (format "srfi-~a" i))
(srfi (string->symbol srfi-name)))
(when (srfi-0-feature-implementation-file srfi)
(stklos:provide srfi-name)))))
(stklos:provide srfi-name))
;; Clean result
(set! slib:features (filter symbol? slib:features)))))
;;;
;;; Redefine require/provide so that symbols use SLIB one and strings use STk one
......
;;;;
;;;; srfi-0.stk -- SRFI-0 aka cond-expand
;;;;
;;;; Copyright 1999-2007 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; Copyright 1999-2008 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 30-Aug-1999 16:26 (eg)
;;;; Last file update: 13-Dec-2007 12:26 (eg)
;;;; Last file update: 27-Aug-2008 13:42 (eg)
;;;;
(define-module SRFI-0
......@@ -131,6 +131,7 @@
;; srfi-93 ; ....... withdrawn
;; srfi-94
;; srfi-95
(srfi-96 "srfi-96") ; SLIB Prerequisites
))
;; ----------------------------------------------------------------------
......
This diff is collapsed.
This diff is collapsed.
/*
* p o r t . c -- ports implementation
*
* Copyright 1993-2007 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
* Copyright 1993-2008 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -20,7 +20,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 17-Feb-1993 12:27
* Last file update: 4-Jul-2007 12:36 (eg)
* Last file update: 27-Aug-2008 13:09 (eg)
*
*/
......@@ -117,6 +117,19 @@ DEFINE_PRIMITIVE("output-port?", output_portp, subr1, (SCM port))
return MAKE_BOOLEAN(OPORTP(port));
}
/*
<doc EXT port?
* (port? obj)
*
* Returns |#t| if |obj| is an input port or an output port,
* otherwise returns #f.
doc>
*/
DEFINE_PRIMITIVE("port?", portp, subr1, (SCM port))
{
return MAKE_BOOLEAN(PORTP(port));
}
/*
<doc EXT interactive-port?
......@@ -1299,7 +1312,7 @@ DEFINE_PRIMITIVE("port-current-line", port_current_line, subr01, (SCM port))
* (port-current-position)
* (port-current-position port)
*
* Returns the position associated to the given input |port| as an
* Returns the position associated to the given |port| as an
* integer (i.e. number of characters from the beginning of the port).
* The |port| argument may be omitted, in which case it defaults to
* the value returned by |current-input-port|.
......@@ -1307,7 +1320,10 @@ doc>
*/
DEFINE_PRIMITIVE("port-current-position", port_position, subr01, (SCM port))
{
if (!PORTP(port)) STk_error_bad_port(port);
if (!port)
port = STk_current_input_port();
else
if (!PORTP(port)) STk_error_bad_port(port);
return MAKE_INT(STk_tell(port));
}
......@@ -1483,6 +1499,7 @@ int STk_init_port(void)
/* and its associated primitives */
ADD_PRIMITIVE(input_portp);
ADD_PRIMITIVE(output_portp);
ADD_PRIMITIVE(portp);
ADD_PRIMITIVE(interactive_portp);
ADD_PRIMITIVE(current_input_port);
ADD_PRIMITIVE(current_output_port);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment