Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(310)

Issue 13509046: code review 13509046: text/template: allow eq to take more than two arguments (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by r
Modified:
10 years, 1 month ago
Reviewers:
adg
CC:
golang-dev, dsymonds, adg
Visibility:
Public.

Description

text/template: allow eq to take more than two arguments Based on an old suggestion by rsc, it compares the second and following arguments to the first. Unfortunately the code cannot be as pretty as rsc's original because it doesn't require identical types.

Patch Set 1 #

Patch Set 2 : diff -r 9112544f0e77 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -35 lines) Patch
M src/pkg/text/template/doc.go View 1 1 chunk +16 lines, -7 lines 0 comments Download
M src/pkg/text/template/exec_test.go View 3 chunks +3 lines, -2 lines 0 comments Download
M src/pkg/text/template/funcs.go View 2 chunks +35 lines, -26 lines 0 comments Download

Messages

Total messages: 9
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
10 years, 1 month ago (2013-09-04 03:08:50 UTC) #1
dsymonds
If you are mentioning that all the logical equations are evaluated, perhaps also mention how ...
10 years, 1 month ago (2013-09-04 03:10:55 UTC) #2
r
That's what I was trying to say. Isn't that what "all the arguments will be ...
10 years, 1 month ago (2013-09-04 03:19:47 UTC) #3
adg
LGTM Docs are clear to me.
10 years, 1 month ago (2013-09-04 03:29:18 UTC) #4
dsymonds
Is arg1 evaluated once, or N-1 times? It could go either way given that there's ...
10 years, 1 month ago (2013-09-04 03:30:42 UTC) #5
r
arg1 is evaluated once. It's a function call. I'm not sure why this is confusing ...
10 years, 1 month ago (2013-09-04 03:33:08 UTC) #6
dsymonds
You call out that all the args are evaluated and there's no short circuiting. That's ...
10 years, 1 month ago (2013-09-04 03:36:51 UTC) #7
r
It's a function call: eq(a, b, c, d). I think it's clear enough. -rob On ...
10 years, 1 month ago (2013-09-04 03:42:02 UTC) #8
r
10 years, 1 month ago (2013-09-04 03:42:31 UTC) #9
*** Submitted as https://code.google.com/p/go/source/detail?r=3ec3ff3de654 ***

text/template: allow eq to take more than two arguments
Based on an old suggestion by rsc, it compares the second
and following arguments to the first.

Unfortunately the code cannot be as pretty as rsc's original
because it doesn't require identical types.

R=golang-dev, dsymonds, adg
CC=golang-dev
https://codereview.appspot.com/13509046
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b