* Fwd: Re: Wrong type argument in procedure variable-set-name-hint!
@ 2005-01-22 19:36 Bruce Korb
2005-02-28 1:48 ` Marius Vollmer
0 siblings, 1 reply; 2+ messages in thread
From: Bruce Korb @ 2005-01-22 19:36 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]
---------- Forwarded Message ----------
Subject: Re: Wrong type argument in procedure variable-set-name-hint!
Date: Saturday 22 January 2005 11:35 am
From: Bruce Korb <bkorb@veritas.com>
To: guile@gnu.org
Cc: autogen-users@lists.sourceforge.net, Matt Kraai <kraai@ftbfs.org>
Hello Guile Folks,
Below is an error message that Matt Kraai gets while trying to
start my autogen program. Would anyone have a guess about
what the cause might be? Attached is the script being run
when this failure occurs.
Thanks for your help! Regards, Bruce
On Saturday 22 January 2005 11:06 am, Matt Kraai wrote:
> > > + /tmp/autogen-5.6.5/agen5/autogen -L/tmp/autogen-5.6.5/autoopts
> > > default-test.def
> > > ERROR: In procedure variable-set-name-hint!:
> > > ERROR: Wrong type argument in position ~A (expecting ~A): ~S
SCM_DEFINE (scm_variable_set_name_hint, "variable-set-name-hint!", 2, 0, 0,
(SCM var, SCM hint),
"Do not use this function.")
#define FUNC_NAME s_scm_variable_set_name_hint
{
SCM_VALIDATE_VARIABLE (1, var);
SCM_VALIDATE_SYMBOL (2, hint);
#if SCM_ENABLE_VCELLS
SCM_SETCAR (SCM_SMOB_DATA (var), hint);
#endif
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
-------------------------------------------------------
[-- Attachment #2: schemedef.scm --]
[-- Type: text/plain, Size: 5942 bytes --]
;;; AutoGen copyright 1992-2004 Bruce Korb
;;;
;;; AutoGen is free software.
;;; You may redistribute it and/or modify it under the terms of the
;;; GNU General Public License, as published by the Free Software
;;; Foundation; either version 2, or (at your option) any later version.
;;;
;;; AutoGen 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 General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with AutoGen. See the file "COPYING". If not,
;;; write to: The Free Software Foundation, Inc.,
;;; 59 Temple Place - Suite 330,
;;; Boston, MA 02111-1307, USA.
;;;
;;; This module defines all the scheme initialization for AutoGen.
;;; It gets sucked up into directives.h as a single ANSI-C string.
;;; Comments, blank lines and leading white space are omitted.
(use-modules (ice-9 common-list))
(define identifier?
(lambda (x) (or (string? x) (symbol? x))))
(define normalize-identifier
(lambda (x)
(if (string? x) (string->symbol x) x)))
(define coerce->string
(lambda (x)
(let ((char->string (lambda (x) (make-string 1 x)))
(coercable? (lambda (x)
(or (string? x) (boolean? x) (char? x)
(symbol? x) (list? x) (number? x)) )) )
(if (not (coercable? x))
(error "Wrong type to coerce->string" x))
(cond
((string? x) (string-append
(char->string #\") x (char->string #\") ))
; Probably not what was wanted, but fun
((boolean? x) (if x "#t" "#f"))
((char? x) (char->string x))
((number? x) (number->string x))
((symbol? x) (symbol->string x))
((list? x) (if (every coercable? x)
(apply string-append (map coerce->string x)) ))
) ) ) )
;;; alist->autogen-def:
;;; take a scheme alist of values, and create autogen assignments.
;;; recursive alists are handled. Using a bare list as a value to be
;;; assigned is not a terribly good idea, though it should work if it
;;; doesn't look too much like an alist The returned string doesn't
;;; contain opening and closing brackets.
(define alist->autogen-def
(lambda (lst . recursive)
(if (null? recursive) (set! recursive #f)
(set! recursive #t))
(let ((res (if recursive "{\n" ""))
(list-nnul? (lambda (x) (and (list? x) (not (null? x))))))
(do ((i lst (cdr i)))
((null? i) (if recursive
(string-append res "}")
res))
(let* ((kvpair (car i))
(value (cdr kvpair))
(value-is-alist (if (and (list-nnul? value)
(list-nnul? (car value))
(list-nnul? (caar value))
(identifier? (caaar value)))
#t #f)))
(set! res (string-append res
(coerce->string (normalize-identifier (car kvpair)))
" = "
(if value-is-alist
(alist->autogen-def (car value) 1)
(coerce->string (cdr kvpair)))
";\n"
) ) ) ) ) ) )
;;; /*=sfunc make_header_guard
;;; *
;;; * what: create ifndef/define guard
;;; *
;;; * exparg: name , header group name
;;; *
;;; * doc: This function will create a @code{#ifndef}/@code{#define}
;;; * sequence for protecting a header from multiple evaluation.
;;; * It will also set the Scheme variable @code{header-file}
;;; * to the name of the file being protected and it will set
;;; * @code{header-guard} to the name of the @code{#define} being
;;; * used to protect it. It is expected that this will be used
;;; * as follows:
;;; * @example
;;; * [+ (make-header-guard "group_name") +]
;;; * ...
;;; * #endif /* [+ (. header-guard) +]
;;; *
;;; * #include "[+ (. header-file) +]"
;;; * @end example
;;; * @noindent
;;; * The @code{#define} name is composed as follows:
;;; *
;;; * @enumerate
;;; * @item
;;; * The first element is the string argument and a separating
;;; * underscore.
;;; * @item
;;; * That is followed by the name of the header file with
;;; * illegal characters mapped to underscores.
;;; * @item
;;; * The end of the name is always, "@code{_GUARD}".
;;; * @end enumerate
;;; *
;;; =*/
;;;
(define header-file "")
(define header-guard "")
(define (make-header-guard hdr-pfx)
(begin
(set! header-file (out-name))
(set! header-guard (string-upcase! (string->c-name! (string-append
(if (string? hdr-pfx) hdr-pfx "HEADER") "_" header-file "_GUARD"
))))
(sprintf "#ifndef %1$s\n#define %1$s" header-guard)
) )
(define autogen-version "AUTOGEN_VERSION")
(define c-file-line-fmt "#line %2$d \"%1$s\"\n")
(define-macro (defined-as predicate symbol)
`(and (defined? ',symbol) (,predicate ,symbol)))
;;; /*=sfunc html_escape_encode
;;; *
;;; * what: encode html special characters
;;; * general-use:
;;; *
;;; * exparg: str , string to make substitutions in
;;; *
;;; * doc: This function will replace replace the characters @code{'&'},
;;; * @code{'<'} and @code{'>'} characters with the HTML/XML
;;; * escape-encoded strings (@code{"&"}, @code{"<"}, and
;;; * @code{">"}, respectively).
;;; =*/
;;;
(define html-escape-encode (lambda (str)
(string-substitute str
'("&" "<" ">")
'("&" "<" ">") ) ))
(use-modules (ice-9 debug))
(read-enable 'positions)
;;; end of agen5/schemedef.scm
[-- Attachment #3: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Fwd: Re: Wrong type argument in procedure variable-set-name-hint!
2005-01-22 19:36 Fwd: Re: Wrong type argument in procedure variable-set-name-hint! Bruce Korb
@ 2005-02-28 1:48 ` Marius Vollmer
0 siblings, 0 replies; 2+ messages in thread
From: Marius Vollmer @ 2005-02-28 1:48 UTC (permalink / raw)
Cc: guile-devel
Bruce Korb <bkorb@veritas.com> writes:
> Below is an error message that Matt Kraai gets while trying to
> start my autogen program. Would anyone have a guess about
> what the cause might be? Attached is the script being run
> when this failure occurs.
Can you give more information about how to reproduce this? Just
running schemedef.scm does nothing, it seems.
Also, what version of Guile is affected?
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-02-28 1:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-22 19:36 Fwd: Re: Wrong type argument in procedure variable-set-name-hint! Bruce Korb
2005-02-28 1:48 ` Marius Vollmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).