ufm: (Default)
[personal profile] ufm

Разработчики голанга утверждают, что такое поведение, это не бага а фича.
Мотивируют так:

But let’s say that you’re using someone else’s library, and you do

Foo(f1(), f2(), f3(), f4(), f5(), f6(), f7(), f8(), f9(), f10())

And the developer of f9() changes the number of values returned. Foo() now reports that you have too many or too few arguments, and you have to check 10 different places and remember how each of them are supposed to match Foo()’s parameters.

Or worse: the compiler doesn’t report an error (Foo() takes a variadic
argument) and your code silently breaks

Мотивировка, конечно, понятная, но как по мне — так это просто косяк при проектировании языка.

Originally published at U.F.M's Homepage. You can comment here or there.

(no subject)

Date: 2014-04-19 15:57 (UTC)
From: [identity profile] avnik.livejournal.com
при этом как я понимаю там нет ничего типа apply.

(no subject)

Date: 2014-04-19 16:11 (UTC)
From: [identity profile] ufm.livejournal.com
что такое apply?

(no subject)

Date: 2014-04-19 16:19 (UTC)
From: [identity profile] avnik.livejournal.com
ну ерланговый и/или лисповый apply

(no subject)

Date: 2014-04-19 16:34 (UTC)
From: [identity profile] ufm.livejournal.com
Я чой-то торможу - а оно тут каким боком?