From 1dc44a802a186a92af984bf951894f4ebfcfcf87 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 6 Mar 2006 02:29:33 +0000 Subject: [PATCH] Change MAKE-RDF-BNODE so that its argument is optional. --- v7/src/xml/rdf-struct.scm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/v7/src/xml/rdf-struct.scm b/v7/src/xml/rdf-struct.scm index 60248bd03..26ca943de 100644 --- a/v7/src/xml/rdf-struct.scm +++ b/v7/src/xml/rdf-struct.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: rdf-struct.scm,v 1.1 2006/02/18 04:31:51 cph Exp $ +$Id: rdf-struct.scm,v 1.2 2006/03/06 02:29:33 cph Exp $ Copyright 2006 Massachusetts Institute of Technology @@ -53,11 +53,18 @@ USA. (define-guarantee rdf-bnode "RDF bnode") -(define (make-rdf-bnode name) - (if (not (and (string? name) - (complete-match match-bnode-name name))) - (error:wrong-type-argument name "RDF bnode name" 'RDF-BNODE)) - (%make-rdf-bnode name)) +(define (make-rdf-bnode #!optional name) + (%make-rdf-bnode + (cond ((default-object? name) + (generate-bnode-name)) + ((and (string? name) + (complete-match match-bnode-name name)) + name) + (else + (error:wrong-type-argument name "RDF bnode name" 'RDF-BNODE))))) + +(define (generate-bnode-name) + (vector-8b->hexadecimal (random-byte-vector 8))) (define-record-type (%make-rdf-literal text type) -- 2.25.1