From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: Re: [Patch] go@1.4 Updated patch Date: Mon, 6 Jun 2016 09:05:23 +0000 Message-ID: References: <87fusuh52h.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> <1464968435.2613720.627094929.3FEBB927@webmail.messagingengine.com> <87d1nygoiq.fsf@mailerver.i-did-not-set--mail-host-address--so-tickle-me> <871t4a7mkr.fsf@igalia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9qTO-0008MO-FF for guix-devel@gnu.org; Mon, 06 Jun 2016 05:05:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9qTN-0007Fx-AN for guix-devel@gnu.org; Mon, 06 Jun 2016 05:05:26 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:36322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9qTN-0007Fr-4n for guix-devel@gnu.org; Mon, 06 Jun 2016 05:05:25 -0400 Received: by mail-oi0-x243.google.com with SMTP id n3so7455467oig.3 for ; Mon, 06 Jun 2016 02:05:24 -0700 (PDT) In-Reply-To: <871t4a7mkr.fsf@igalia.com> 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: Andy Wingo Cc: guix-devel@gnu.org, Matthew Jordan Hello, I think match-lambda is not documented in the guile manual (it only appears in an example). While its usage is more or less the same as in racket, I think it should be documented. What is your idea? Thanks, Alex On 06/06/2016, Andy Wingo wrote: > Hi :) > > Looking good! I have some style nits :) > > On Fri 03 Jun 2016 19:39, Matthew Jordan > writes: > >> + ;; Removing net/ tests >> + (for-each >> + (lambda (srcfile) >> + (let ((srcfile (string-append "net/" srcfile))) >> + (if (file-exists? srcfile) >> + (delete-file srcfile)))) >> + '("multicast_test.go" "parse_test.go" "port_test.go")) > > Either these files exist or they do not. Better to just have three > unconditional delete-file invocations. > >> + >> + ;; Add libgcc to runpath >> + (substitute* "cmd/go/build.go" >> + (("cgoldflags := \\[\\]string\\{\\}") >> + (string-append "cgoldflags := []string{" >> + "\"-rpath=" gcclib "\"" >> + "}")) >> + (("ldflags := buildLdflags") >> + (string-append >> + "ldflags := buildLdflags\n" >> + "ldflags = append(ldflags, \"-r\")\n" >> + "ldflags = append(ldflags, \"" gcclib "\")\n"))) >> + >> + (substitute* "os/os_test.go" >> + (("/usr/bin") (getcwd)) >> + (("/bin/pwd") (which "pwd"))) >> + >> + ;; Disable failing tests >> + (for-each >> + (lambda (srcfile) >> + (substitute* (car srcfile) >> + (((cdr srcfile) all) (string-append all >> "return\n")))) > > Is this a nice way to disable tests? I dunno. Why not change the test > name from TestFoo to DisabledTestFoo ? Then it would not get run. > > Also let's avoid car and cdr, and instead use match-lambda: > > (match-lambda > ((file . pattern) > ...)) > > But let's also avoid dotted pairs in bigger literal data structures; > it's ugly when there's lots of punctuation around. So if you change the > lines to be like > > ("net/net_test.go" ".+TestShutdownUnix.+") > > you can > > (match-lambda > ((file pattern) > ...)) > > Note the lack of " . ". > >> + (list >> + '("net/net_test.go" . ".+TestShutdownUnix.+") >> + '("net/dial_test.go" . ".+TestDialTimeout.+") > > Here make the whole list a literal instead of calling `list' on a list > of quoted datums: > > '(("net/net_test.go" ".+TestHostname.+") > ...) > > Cheers, > > Andy > >