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

Interesting. I hadn't come across that idiom before. In Python, you'll have things like:

  myLongList = [1, 2, 3,
                4, 5, 6,
                7, 8, 9]
No continuation character is needed, because the continuation is implied.

However, I can't think of a direct parallel to your example above. It looks handy. What API/language are you alluding to?

I guess the Pythonic way would be something like:

  win = Window(title = "A new window",
               foreground = "Red",
               background = "White",
               menuBar = [fileMenu, viewMenu, helpMenu])
But I disgress. :^)



JavaScript can just as easily attain this way of using named parameters:

  win = Window.new({title: "A new window",
                    foreground: Red,
                    background: White,
                    menuBar: [fileMenu, viewMenu, helpMenu]});


What API/language are you alluding to?

As i said before: no particular language.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: