Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 2
    I don't see an advantage for myRandom () = new Random over myRandom = new Random() if I am reading you correctly. Commented Jul 11, 2015 at 23:44
  • Isn't this exactly what Haskell does? Well, except that variable = expression defines an unchangeable binding rather than assigning to a variable. Commented Jul 12, 2015 at 0:10
  • 2
    In imperative or object-oriented programming languages, functions without arguments are actually very common, so banning them would be a quite bad idea. On the other hand, they are far less common in purely functional languages. We don't know nearly enough about the design of your language to provide any helpful advise. I voted to close this question as primarily opinion-based. Commented Jul 12, 2015 at 0:28
  • 1
    This is what you would do in [s, Oca]ml to declare a function taking no interesting parameters. unit -> foo is a common type when declaring "This has some side-effects and computes a foo" Commented Jul 12, 2015 at 2:26
  • 1
    @ChristopherLord Not the case in my language: there are side effects. Commented Jul 14, 2015 at 8:16