Comment

Comment by n13

Agree & Voted.

Another alternative that I would like is to have angle brackets < > for better readability, so that definition and call would look as follows:

  // 1
  func Print2<type T1, T2>(s1 []T1, s2 []T2) { ... }
  Print2<int,int>( ... )
  
  // 2
  var v Vector<int>
  
  // 3
  func (v *Vector<Element>) Push(x Element) { *v = append(*v, x) }
Sorry, if it gives you C++ nightmares.
parent n13 7 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton