On Sat 14 May 2016 22:27, Jan Nieuwenhuizen <jann...@gnu.org> writes:
> Andy Wingo writes: > > Something I wanted to ask and I guess now why don't we let functions > like pair?, null?, string-prefix? not return the thing itself? So many possible answers, none of them great ;) For example, why have #t as a value at all -- I don't know :) But more directly: pair? only returns a boolean because the standard convention is that a function with a ? on the end returns a boolean. A counter example is `assoc': it returns a pair or #f, and has no trailing `?'. As to why have predicates -- well the idea is that a predicate doesn't do lookup and doesnt' retrieve a value, it just partitions its domain. You don't need to return the value because you already have the value -- you passed it as the argument. Also consider boolean? -- what should (boolean? #f) return? Anyway that's how predicates are understood by most other Scheme programmers. > diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm > (define* (cross-gcc target > #:optional (xbinutils (cross-binutils target)) libc) > "Return a cross-compiler for TARGET, where TARGET is a GNU triplet. Use > @@ -223,7 +309,10 @@ GCC that does not target a libc; otherwise, target that > libc." > (append > (origin-patches (package-source %xgcc)) > (cons (search-patch "gcc-cross-environment-variables.patch") > - (cross-gcc-patches target)))))) > + (cross-gcc-patches target)))) > + (modules '((guix build utils))) > + (snippet > + (cross-gcc-snippet target)))) > > ;; For simplicity, use a single output. Otherwise libgcc_s & co. are not > ;; found by default, etc. > @@ -245,6 +334,7 @@ GCC that does not target a libc; otherwise, target that > libc." > #:target target > #:binutils xbinutils)) > ("binutils-cross" ,xbinutils) > + ("gcc" ,gcc) > > ;; Call it differently so that the builder can check whether the > "libc" > ;; input is #f. Why did you add GCC here? Why was it not needed before? Other than this nit, LGTM. Andy