From 63b468b2932bad1ff6f46afc9830d3d706b1bdd9 Mon Sep 17 00:00:00 2001 From: "Taylor R. Campbell" Date: Sat, 21 Mar 2009 16:28:35 +0000 Subject: [PATCH] Signal a better error in PORT-POSITION and SET-PORT-POSITION! if the port does not support these operations. --- v7/src/runtime/port.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/v7/src/runtime/port.scm b/v7/src/runtime/port.scm index 168d64654..511b790bb 100644 --- a/v7/src/runtime/port.scm +++ b/v7/src/runtime/port.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: port.scm,v 1.59 2008/08/18 06:40:18 cph Exp $ +$Id: port.scm,v 1.60 2009/03/21 16:28:35 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -452,10 +452,14 @@ USA. (define-port-operation discretionary-flush-output) (define (port-position port) - ((port/operation port 'POSITION) port)) + ((or (port/operation port 'POSITION) + (error:bad-range-argument port 'PORT-POSITION)) + port)) (define (set-port-position! port position) - ((port/operation port 'SET-POSITION!) port position)) + ((or (port/operation port 'SET-POSITION!) + (error:bad-range-argument port 'SET-PORT-POSITION!)) + port position)) (set-record-type-unparser-method! (lambda (state port) -- 2.25.1