DEV Community

Discussion on: The Coolest Programming Language Features

Collapse
 
renegadecoder94 profile image
Jeremy Grifski

Oh, so this is pretty cool. Let me try to understand it better. Instead of writing a constructor with ten parameters, you can expose properties that can be set with an extension lambda?

Collapse
 
cout970 profile image
cout970 • Edited

yes, basically, but it has a lot more uses!, for example there is a library that allows you to write html using extension lambdas and it looks like this:

html {
  head {
    title { +"Page title" }
  }
  body {
    h1{ + "Cool article" }
    p { +"article content" }
  }
}

they have the same flexibility as normal lambdas but with a lot less boilerplate

Thread Thread
 
renegadecoder94 profile image
Jeremy Grifski

Wow that’s elegant. I imagine you get the added benefit of type checking and whatnot, right?

Thread Thread
 
cout970 profile image
cout970

Yes!