Nov. 7th, 2013

gemelen: (Default)
Сводя к минимуму встретившуюся ситуацию, получаем такой groovy-код:
  class B {List xs}

  def a = [1,2,null, 3]
  def b = new B()
  b.xs = a

  def c = b.xs.sum {i = it -> i != null ? i : 0}
  println c
// 6

Однако, переходя в реальный код, когда объекты чуть сложнее слабанного на коленке, получаем уже мистическую картину.
  // структура из распарсенного xml
  // a.b.c.d.e, где e - интовое поле
  result = a.b?.c?.sum 
{ i = it?.d?.e  
  -> 
  i != null 
    ? i 
    : 0 
}

Вуаля, в i у нас нифига не e, а как раз самое d и поэтому видим КРОВЬКИШКИ. Чинится банально, хоть и не так выпендрёжно.
  result = a.b?.c?.sum 
{ it?.d?.e != null 
? it?.d?.e 
: 0 }
gemelen: (Default)
Для Н.:

QUESTION:
After reading Robert Heinlein's Starship Troopers and Ender's Game, I have noticed them to be very similar. The enemy is similar. The training is similar. There is some similar philosophy, or at least it seems the way of philosophy expressed in dialogue is similar. You have said yourself that you have read Heinlein's work. My question is: to what extent is Ender's Game, if any, influenced by Starship Troopers?

OSC(Orson Scott Card) REPLIES: - February 2, 2000

I have never read "Starship Troopers." I HAVE read "Forever War" by Joe Haldeman, which is said by some to be a response to "Starship Troopers," but I did not read "Forever War" until after writing the short story of "Ender's Game." So "Starship Troopers" could not have been an influence, conscious or otherwise, on "Ender's Game."

One should keep in mind that the insectoid alien was a cliche in science fiction long before Heinlein used such creatures in "Starship Troopers." I assume that he used them for the same reason I did -- because what mattered to the story was not the alien species per se, but rather the fact that humans were at war, so a generic alien would do. (Of course, in the process of writing the novels we both, I assume, tried to make them more than generic aliens, but in choosing the alien type, going for the insectoid look-and-feel is hardly original.) And the tradition of writing about the training of young people is called "bildungsroman" and it's also very, very old.

In short, the resemblances between "Starship Troopers" and "Ender's Game" are coincidental -- Heinlein and I simply made a few similar choices in attempting similar projects.

Можно даже поверить, "Звёздный десант" вышел опубликован в 59ом, "Игра" в - 89ом, плюс экранизация первого была уже после второй даты. Но схожесть занятная.

Profile

gemelen: (Default)
gemelen

June 2025

M T W T F S S
      1
2345678
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 3rd, 2025 13:30
Powered by Dreamwidth Studios