Assignment versus binding

Rustom Mody rustompmody at gmail.com
Wed Oct 5 02:19:57 EDT 2016


On Wednesday, October 5, 2016 at 11:34:31 AM UTC+5:30, Gregory Ewing wrote:
> Steve D'Aprano wrote:
> 
> > And (shamelessly using Python syntax) if I have a function:
> > 
> > def spam(x):
> >     print(x)
> >     print(x+1)
>  >
>  > spam(time.sleep(60) or 1)
> 
> You can't write that in Haskell, because Haskell's
> equivalent of print() is not a function (or at least
> it's not a function that ever returns), and neither
> is sleep().

Its ironical:
- Function in Fortran was meant to emulate math-functions
- C took the same thing and did a ‘small little syntax elision’ viz
conflating function and subprogram (procedure in Pascal speak) all under
the heading of function. In Pascal it was certainly a publicised intent
to sharply distinguish functions — no side-effects — from procedures — no return value.
- Finally this abuse of notation (and notions) has become such a norm (normal!)
that people are surprised to find non-abusive languages!



More information about the Python-list mailing list