News for hackers. Stuff that matters.
Re:Streem – a new programming language from Matz by PhearTheCeal on Thursday December 11, 2014 @01:24PM (#8736273)
noice, here's my version

    print("\n".join([("FIZZ"*(i%3==0)+"BUZZ"*(i%5==0)) or str(i) for i in range(1,101)]))
Re:Streem – a new programming language from Matz by kaonashi on Thursday December 11, 2014 @01:33PM (#8736320)
I would hope never to find a bomb like that in the code I'm maintaining.
Re:Streem – a new programming language from Matz by SwellJoe on Thursday December 11, 2014 @02:36PM (#8736639)
Really? I find that one line far more pleasant than the Python example above it, with variables being assigned, etc. Both are quite clear in their intention, I think, assuming you recognize "join".

I don't even recognize the language of the one-liner, but it makes perfect sense to me as a reader. It looks like a Perlish solution, but the string method is strange, I think. Maybe Perl 6 or Ruby?

Re:Streem – a new programming language from Matz by nostrademons on Thursday December 11, 2014 @02:48PM (#8736691)
The one-liner is valid Python. It's slightly non-idiomatic in that it uses a list-comprehension where a generator expression would do, and uses range instead of xrange (in Python 2.x; in 3.x range is the idiomatic alternative).
Re:Streem – a new programming language from Matz by nightpool on Thursday December 11, 2014 @03:05PM (#8736781)
it's also non-idomatic in that is uses string-multiplication and ==0 where an "if not" ternary expression would be much cleaner.
Re:Streem – a new programming language from Matz by SwellJoe on Thursday December 11, 2014 @04:12PM (#8737087)
Yes, a ternary would be clearer, to me. I wasn't sure what was happening with the * (and thought maybe it was some use of the "whatever star" in Perl 6, when I was thinking it might be Perl 6, though it doesn't look like any use of the whatever star I've seen), but I just assumed it made sense to someone who knew the language well. It's been a decade since I worked in Python with any regularity.
Re:Streem – a new programming language from Matz by nostrademons on Thursday December 11, 2014 @04:23PM (#8737129)
I would probably use a named function call in real code, but the 'text * (expr == 0)' idiom is pretty clear to me as a way to conditionally include text based on whether a condition is true or not.
Re:Streem – a new programming language from Matz by cgh on Thursday December 11, 2014 @02:47PM (#8736689)
It's Python as well.
Re:Streem – a new programming language from Matz by nostrademons on Thursday December 11, 2014 @02:46PM (#8736682)
I found the one-liner perfectly readable. List comprehensions, short-circuiting OR and str.join are pretty idiomatic Python.
Re:Streem – a new programming language from Matz by a3n on Thursday December 11, 2014 @06:15PM (#8737614)
Similar:

  print '\n'.join(['FizzBuzz' if x % 15 == 0
      else 'Fizz' if x % 3 == 0
      else 'Buzz' if x % 5 == 0
      else str(x) for x in range(1, 101)])
Re:Streem – a new programming language from Matz by coldtea on Thursday December 11, 2014 @03:49PM (#8736992)
Starting now with this programming thing, right?

This is straight poser code -- inadvisable in any real life situation, and not that robust either.

Re:Streem – a new programming language from Matz by pablovidal85 on Thursday December 11, 2014 @08:34PM (#8738144)
slightly shorter javascript:

  for (var i=0; i++<100;) console.log((!(i%3)&&'Fizz'||'')+(!(i%5)&&'Buzz'||'')||i);