Hacker News new | past | comments | ask | show | jobs | submit login

You can in most modern or functional languages, by currying/partial evaluation/binding. It's rare for data classes.

In scala:

    case class Foo(a: Int, b: String)
    val halfBuilt: String => Foo = Foo(1, _)
    val foo = halfBuilt("foo")



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: