bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10474: Building guile 2.x under mingw + msys


From: Ludovic Courtès
Subject: bug#10474: Building guile 2.x under mingw + msys
Date: Tue, 19 Feb 2013 13:55:36 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Andy Wingo <address@hidden> skribis:

> +(let-syntax ((compile-time-case
> +              (lambda (stx)
> +                (syntax-case stx ()
> +                  ((_ exp clauses ...)
> +                   (let ((val (primitive-eval (syntax->datum #'exp))))
> +                     (let next-clause ((clauses #'(clauses ...)))
> +                       (syntax-case clauses (else)
> +                         (()
> +                          (syntax-violation 'compile-time-case
> +                                            "all clauses failed to match" 
> stx))
> +                         (((else form ...))
> +                          #'(begin form ...))
> +                         ((((k ...) form ...) clauses ...)
> +                          (if (memv val (syntax->datum #'(k ...)))
> +                              #'(begin form ...)
> +                              (next-clause #'(clauses ...))))))))))))
> +  ;; emacs: (put 'compile-time-case 'scheme-indent-function 1)
> +  (compile-time-case (system-path-convention)
> +    ((posix)
> +     (define (path-separator? c)
> +       (char=? c #\/))
> +
> +     (define path-separator-string "/")
> +
> +     (define (absolute-path? path)
> +       (string-prefix? "/" path)))

I think we must stick to GNU conventions–i.e., write “file name” when
speaking of the name of a file, as above, and “path” when speaking of a
search path.

This is important here because sooner or later someone will ask about
“path separators” (semicolon vs. colon), not to be confused with file
name or directory separators.

WDYT?

(Yes, there are counter-examples in Guile code, but that’s no excuse. ;-))

> +    ((windows)
> +     (define (path-separator? c)
> +       (or (char=? c #\/)
> +           (char=? c #\\)))
> +
> +     (define path-separator-string "\\")
> +
> +     (define (absolute-path? path)
> +       (define (unc-path?)
> +         ;; Universal Naming Convention (UNC) paths start with \\, and
> +         ;; are always absolute.
> +         (string-prefix? "\\\\" path))

What about adding here a link to a page that describes “UNC”?

Otherwise, looks good to me, and it’s great that progress is made on
that front!

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]