Previous Entry Add to Memories Share Next Entry
More grossness
[info]demoness101
I just want to create a damn pair.

(actual code follows)
new Pair
[Error: Irreparable invalid markup ('<methodwrapper,>') in entry. Owner must fix manually. Raw contents below.]

I just want to create a damn pair.

(actual code follows)
new Pair<MethodWrapper, List<MethodWrapper>>(result, new ArrayList<MethodWrapper>())

Sigh. In a civilized language, this would be simply "(result, nil)".
Tags: ,

Man, your language is made out of irreparable invalid markup.

Wow...that's impressive, and terrifying.

Hey, jcreed: if you want to sex up your CV, try turning all that proof irrelevance stuff you're doing for Twelf into stuff for Java</a>, because everything is more fashionable in Java. And then demoness101 can create her pair without swearing. :)

Wow, I just now saw that.

New Java 1.5! Now with more irreparable invalid markup goodness.

Probably obvious

(Anonymous)

2005-07-01 04:41 pm (UTC)

This is probably obvious, but I usually try to take the most advantage of the type inferencer as possible and make static factory methods on my classes. For example,

class Pair<T,U> {
  public static Pair<T,U> make( T t, U u ) { return new Pair<T,U>( t, u ); }
}

Re: Probably obvious

(Anonymous)

2005-07-01 04:42 pm (UTC)

Oops. Missing a few type parameters in that method, but you get the idea.

You are viewing [info]demoness101's journal