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

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:
4 years, 2 months ago by r
Modified:
4 years, 2 months 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/
4 years, 2 months 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 ...
4 years, 2 months 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 ...
4 years, 2 months ago (2013-09-04 03:19:47 UTC) #3
adg
LGTM Docs are clear to me.
4 years, 2 months 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 ...
4 years, 2 months 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 ...
4 years, 2 months 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 ...
4 years, 2 months 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 ...
4 years, 2 months ago (2013-09-04 03:42:02 UTC) #8
r
4 years, 2 months 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 c59f3c4