3 ms·
> From [1] The Hello World program: hello.zu: FUNC Main() int IO.write("Hello, World!\n") RETURN 0 } > Notes: > ... > The } characte
by andrewla 4y ago
> From [1]
The Hello World program: hello.zu:
FUNC Main() int
IO.write("Hello, World!\n")
RETURN 0
}
> Notes:
> ...
> The } character is used to end a block. There is no {, we know where the block starts. This avoids useless discussions about where to put the {.
Excuse me, WHAT? When I saw the first code snippet I thought there was a typo, but the idea of using an unmatched close brace is so horrifying to me that I really have trouble looking further at this. Oddly the first thing that occurs to me is that in Vim it makes it hard to move between the beginning and end of a block, but I think I can safely assume that the author is fairly familiar with using Vim, seeing as he wrote it.
[1] http://www.zimbu.org/getting-started/hello-worlkd http://www.zimbu.org/getting-started/hello-worlkd
- gilch 4y agoHardly a unique idea. J also does this in explicit function definitions, but with `)`. https://code.jsoftware.com/wiki/JPhrases/ExplicitDef https://code.jsoftware.com/wiki/JPhrases/ExplicitDef
- nitrix 4y agoThe actual typo in the URL slug is on the nose too ("worlkd").
- carapace 4y agoMentally rewrite "}" to "ENDFUNC"? Having avoided useless discussion about where to put the "{" let's not start one about how to spell "end of block", eh? At least it's not some Unicode sigil.
- mrtweetyhack 4y ago
- codeflo 4y agoThere seems to be a LAMBDA ... } syntax as well that works as an expression. Along with the upper case keywords, I'm convinced this language is meant as a joke, but it's very, very subtle. For example, the "Inspiration" page lists as one of the things it intends to borrow from Java, "use of design patterns": http://www.zimbu.org/design/inspiration http://www.zimbu.org/design/inspiration Like the one thing people love about Java are all the AbstractFactoryFactoryFactories.