Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'programmer': 0.03; 'value,': 0.04; 'argument': 0.05; 'explicitly': 0.05; 'say,': 0.05; 'subject:Python': 0.06; 'compiler': 0.07; 'plenty': 0.07; '(first': 0.09; 'null,': 0.09; 'runtime': 0.09; 'works.': 0.09; 'worse': 0.09; 'cc:addr:python-list': 0.11; 'wrote': 0.14; 'btw': 0.16; 'bugs.': 0.16; 'coercion,': 0.16; 'coercion.': 0.16; 'denotes': 0.16; 'enough.': 0.16; 'expecting': 0.16; 'expects': 0.16; 'fits': 0.16; 'haskell,': 0.16; 'literals': 0.16; 'rest)': 0.16; 'sense,': 0.16; 'substitute': 0.16; 'thread,': 0.16; 'java,': 0.16; 'weird': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'figures': 0.19; 'feb': 0.22; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'integer': 0.24; 'large,': 0.24; 'pointer': 0.24; 'java': 0.24; 'paul': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'pass': 0.26; 'values': 0.27; 'header:In- Reply-To:1': 0.27; 'point': 0.28; 'said,': 0.30; 'message- id:@mail.gmail.com': 0.30; 'skip:( 20': 0.30; 'program,': 0.31; 'int,': 0.31; 'reflected': 0.31; 'though.': 0.31; 'writes:': 0.31; 'run': 0.32; 'community': 0.33; '(e.g.': 0.33; "can't": 0.35; 'something': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'leads': 0.36; 'depends': 0.38; 'e.g.': 0.38; 'pm,': 0.38; 'how': 0.40; 'break': 0.61; 'length': 0.61; 'term': 0.63; 'different': 0.65; 'subject:! ': 0.74; '2015': 0.84; 'different.': 0.84; 'evaluation.': 0.84; 'lazy': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ytCgR/p8kxesJA90VEci8i3RAKrE+ljf2J6BS1n4+Rg=; b=uMT1Ez/7YRg2xXbV0vkxreYm6PzAI8L/ZZLzoyvUtcpXPEbE5HlgjPgCtXhjgj266R ixvdgtoKtJVs+M9k8U2l3gNOLLlFI/ksw9WTP3RMDgR/sc46VT9DY3nM1JdULuuGRjaw tUHTKI9Oedx5j/Cl65go7thwdlQp153Ttv7ZDjH4nFNTCy3SKwvwwCulsrVgKHEXsBCh Lm66P6DZV8WKkxdPkX6GIy+WiBwg3DarOFzfQcmVUN7KFjW9vE5TIP2Hcuwq2uFymxnk KcWBPQUfIqMhKhuOoHaPytnzMRNYFTr9ZbgnlK+T0SrPdLbqFOTsBD7eNefFGbpDdLkt d43A== X-Received: by 10.140.16.163 with SMTP id 32mr31972333qgb.22.1422831182690; Sun, 01 Feb 2015 14:53:02 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <87siep2rp4.fsf@jester.gateway.sonic.net> References: <54c07d04$0$13012$c3e8da3$5496439d@news.astraweb.com> <6eb91c4b-92ff-44a8-b5a9-6ef04c71f4cb@googlegroups.com> <35a40ec6-3763-448b-9ea4-4a233a04979b@googlegroups.com> <54c1ccc8$0$13005$c3e8da3$5496439d@news.astraweb.com> <54c6d7c2$0$12992$c3e8da3$5496439d@news.astraweb.com> <54c83ab4$0$12982$c3e8da3$5496439d@news.astraweb.com> <54ca583e$0$13005$c3e8da3$5496439d@news.astraweb.com> <54ccc2fc$0$13009$c3e8da3$5496439d@news.astraweb.com> <8761bm40ud.fsf@jester.gateway.sonic.net> <87siep2rp4.fsf@jester.gateway.sonic.net> From: Devin Jeanpierre Date: Sun, 1 Feb 2015 14:52:22 -0800 Subject: Re: Python is DOOMED! Again! To: Paul Rubin Content-Type: text/plain; charset=UTF-8 Cc: "comp.lang.python" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1422831190 news.xs4all.nl 2959 [2001:888:2000:d::a6]:34461 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 6933 X-Received-Body-CRC: 716055821 Xref: csiph.com comp.lang.python:85034 On Sun, Feb 1, 2015 at 2:27 PM, Paul Rubin wrote: > Devin Jeanpierre writes: >> That said, Haskell (and the rest) do have a sort of type coercion, of >> literals at compile time (e.g. 3 can be an Integer or a Double >> depending on how you use it.) > > That's polymorphism, not coercion. OK, yes, that fits better into how Haskell works. After all, that's how "Nothing" works. If 3 is just a (magic) constructor, then it's no different. > The compiler figures out at compile > time what type of 3 you actually mean: there is never an automatic > runtime conversion. sqrt(3) works because sqrt expects a floating > argument so the compiler deduces that the 3 that you wrote denotes a > float. sqrt(3+length(xs)) has to fail because length returns an int, so > 3+length(xs) is an int, and you can't pass an int to sqrt. > >> BTW it's weird that in this thread, and in the programmer community at >> large, int->string is considered worse than int->float > > Hehe, though int->string leads to plenty of weird bugs. > >>> Haskell's idiomatic substitute for a null pointer is a Nothing value >> For that matter, how is this (first part) different from, say, Java? > > In Java, functions expecting to receve sensible values can get null by > surprise. In Haskell, if a term can have a Nothing value, that has to > be reflected in its type. Haskell's bug-magnet counterpart to Java's > null values is Bottom, an artifact of lazy evaluation. E.g. you can > write > x = 3 / 0 > someplace in your program, and the program will accept this and run > merrily until you try to actually print something that depends on x, > at which point it crashes. This isn't a difference in whether there are multiple nulls, though. I answered my own question later, by accident: Java nulls are castable to each other if you do it explicitly (routing through Object -- e.g. (Something)((Object) ((SomeOtherThing) null)))). So in that sense, there is only one null, just with some arbitrary compiler distinctions you can break through if you try hard enough. -- Devin