Functional programming

88888 Dihedral dihedral88888 at gmail.com
Tue Mar 4 01:35:34 CET 2014


On Monday, March 3, 2014 10:08:11 PM UTC+8, Rustom Mody wrote:
> On Monday, March 3, 2014 7:30:17 PM UTC+5:30, Chris Angelico wrote:
> 
> > On Tue, Mar 4, 2014 at 12:48 AM, Rustom Mody wrote:
> 
> > > ? [1,2] + [[3,4],[5]]
> 
> > > ERROR: Type error in application
> 
> > > *** expression     : [1,2] + [[3,4],[5]]
> 
> > > *** term           : [1,2]
> 
> > > *** type           : [Int]
> 
> > > *** does not match : [[Int]]
> 
> > > IOW [1,2,[3,4],[5]]
> 
> > > is a type-wise ill-formed expression just as in python
> 
> > > [[1,2])
> 
> > > is syntax-wise ill-formed
> 
> > > Is it worth having such a restriction?
> 
> > > Thats a different argument...
> 
> 
> 
> > How do you know that [1,2] is a list that must contain nothing but
> 
> > integers? By extension, it's also a list that must contain positive
> 
> > integers less than three, so adding [5] violates that. And [] is a
> 
> > list that must contain nothing, ergo it can't be added to, although
> 
> > (since it contains nothing) it can be added to anything.
> 
> 
> 
> If 'integer-less-than-3' were a type then yes there would be this
> 
> problem. More generally, if types could overlap then automatic
> 
> type-inference is impossible
> 
> 
> 
> Whether all thats good is as I earlier said a different argument
> 
> 
> 
> The OP asked about FP and so its appropriate to mention how python's
> 
> and standard FPL's choices differ

OK, lets talk about the real 
meats of high-level dynamical typed
languages.

Test the claim that the old OOP programs and modules can use the new objects and programs written or obtained later in the run time.



More information about the Python-list mailing list