From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: [PATCH 02/11] gnu: cross-build: i686-w64-mingw32: new cross target. Date: Tue, 17 May 2016 09:43:56 +0200 Message-ID: <87wpmtqgcj.fsf@igalia.com> References: <1462740169-15029-1-git-send-email-janneke@gnu.org> <1462740169-15029-3-git-send-email-janneke@gnu.org> <87oa8f3dn5.fsf@igalia.com> <87twi09yhg.fsf@drakenvlieg.flower> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2Zfj-000372-2W for guix-devel@gnu.org; Tue, 17 May 2016 03:44:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2Zfd-0005V5-TY for guix-devel@gnu.org; Tue, 17 May 2016 03:44:05 -0400 In-Reply-To: <87twi09yhg.fsf@drakenvlieg.flower> (Jan Nieuwenhuizen's message of "Sat, 14 May 2016 22:27:23 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Jan Nieuwenhuizen Cc: guix-devel@gnu.org On Sat 14 May 2016 22:27, Jan Nieuwenhuizen 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