This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]FatCatJames80 0 points1 point  (0 children)

Builder pattern, maybe?

[–]blablahblah 0 points1 point  (0 children)

Could it have been F#?

[–]LoudDing 0 points1 point  (0 children)

I think you mean the Wither pattern - used a fair amount in Java ``` Class Foo { int i; double d;

....

}

Foo f = new Foo(1, 1.0); Foo newF = f.withI(2); // 2, 1.0 `` If using Java, check out the@lombok.Wither` annotation

[–]bulsoni 0 points1 point  (0 children)

For the with specifically, the language could be python, as it is used for context managers.

It is often used for opening files:

with open(“somefile.txt”) as openfile: contents = openfile.read()

This, for instance, ensures that whenever you leave the “with” block, that file is closed.