> Procedure overloading is the ability to define different implementations of 
> procedures with the same name. Each of these procedures shares the same name 
> but accept different parameters. Depending on the arguments passed to the 
> procedure, the appropriate implementation is picked by the compiler.
> 
> In my interpretation fac(0) satisfies this definition

How, odd, because it surely doesn't; 0 is not a parameter. Parameters are typed 
symbols that abstractly represent the values passed to a procedure; they are 
not values and are in a different conceptual space from values. fac(0) is an 
invocation of a procedure, not a definition of one.

The quoted text could be clearer by saying "accept different numbers of 
parameters or parameters of different types".

This really isn't a matter of functional vs. imperative languages, it's a 
matter of basic language syntax. Functional languages need not offer 
Haskell-style matching syntax, and imperative languages could. Note that, in 
Haskell, you have to provide a type signature in addition to the pattern 
matching; the type signature is comparable to procedure signatures in Nim and 
other languages. Note that Haskell's
    
    
    factorial :: (Integral a) => a -> a
    factorial 0 = 1
    factorial n = n * factorial (n - 1)
    
    
    Run

looks nothing like your
    
    
    proc fac(0): int = 1
    proc fac(n: int): int = n*fac(n-1)
    
    
    Run

The Haskell has a type signature and then two lines that match the value of the 
argument. Your first line is a mishmash of the two concepts and fails to 
identify the type of 0. No language works like that because it would be 
terrible language design.

Reply via email to