From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.user Subject: Re: A bit further toward the flamewar Date: Thu, 13 Oct 2011 16:42:45 -0500 Message-ID: References: <20111012153958.GA20242@ccellier.rd.securactive.lan> <87pqi2ca3q.fsf@gnu.org> <8739exry15.fsf@pobox.com> <20111013112709.GA28078@ccellier.rd.securactive.lan> <87r52hc6hu.fsf@gnu.org> <87r52grk90.fsf@pobox.com> <1318531070.78010.YahooMailNeo@web37908.mail.mud.yahoo.com> Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1318542198 3459 80.91.229.12 (13 Oct 2011 21:43:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 13 Oct 2011 21:43:18 +0000 (UTC) Cc: Andy Wingo , =?UTF-8?Q?Ludovic_Court=C3=A8s?= , "guile-user@gnu.org" To: Mike Gran Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Oct 13 23:43:13 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RET3Y-0006VN-8H for guile-user@m.gmane.org; Thu, 13 Oct 2011 23:43:12 +0200 Original-Received: from localhost ([::1]:54383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RET3X-0003FB-MI for guile-user@m.gmane.org; Thu, 13 Oct 2011 17:43:11 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RET3U-0003F4-2u for guile-user@gnu.org; Thu, 13 Oct 2011 17:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RET3S-0004Jo-Pk for guile-user@gnu.org; Thu, 13 Oct 2011 17:43:07 -0400 Original-Received: from mail-bw0-f41.google.com ([209.85.214.41]:49689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RET3S-0004Jk-Hk; Thu, 13 Oct 2011 17:43:06 -0400 Original-Received: by bkbzu5 with SMTP id zu5so1575966bkb.0 for ; Thu, 13 Oct 2011 14:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=jO6x2Cxl5QGEcCzLteS8tP9dFyH+QXpF3bFteqxlERs=; b=aYPpRmrq9iQasa8IffVRoM823b7h8DRIEYY0CiYKFV5Tc9PfXwUH95aMh2DqOwrCGS Rcz8sZf9IdCb1HiH8sIhBERCEx8hOEQd2jkBZn+SihcURzCKPn8ttyCEuTP51UcS9S3X jRX+7vihkmrYxDwLzjqQdH/+NCaVv3CC/7YlA= Original-Received: by 10.204.135.207 with SMTP id o15mr4255225bkt.92.1318542185239; Thu, 13 Oct 2011 14:43:05 -0700 (PDT) Original-Received: by 10.223.3.11 with HTTP; Thu, 13 Oct 2011 14:42:45 -0700 (PDT) In-Reply-To: <1318531070.78010.YahooMailNeo@web37908.mail.mud.yahoo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.41 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8878 Archived-At: On 13 October 2011 13:37, Mike Gran wrote: > >>> =C2=A0Anyway this second, proof side of types, is the side that Scheme = does >>> =C2=A0not have. =C2=A0C has a stronger story in that regard. >> >> Lack of types in scheme has made me day-dream about learning >> ocaml or haskell.=C2=A0 My pet peeve about scheme is that, when >> maintaining old code, its very very hard to just "know" what type >> some lambda is expecting.=C2=A0 And, to me, this makes scheme >> sometimes very hard to read. >> >> very-hard-to-read =3D=3D bug-prone >> > > It is hard to know what types a procedure expects.=C2=A0 I've wondered > why paradigms like the following weren't more popular. > > (define (func a b) > =C2=A0 (assert-string a) > =C2=A0=C2=A0(assert-list b) > =C2=A0=C2=A0 ... > > In the great never-ending Lisp/Scheme flamewar, I always end up > on the "Lisp/Scheme lacks visual clues" side of the argument.=C2=A0 Schem= e > is just hard to read. In the code that I work on, in (func a b), its rarely the case that a and b are merely strings or lists; they're usually some fairly complex structure, where e.g. 'b' is a list where car and cadr must be strings, and caddr may or may not be another list, with certain expectations about car, cadr, etc. I have no clue why it never occurred to me to use the above paradigm, I will definitely start experimenting with it. Any clue on how to indicate that func returns type 'X' ? I don't know if you were trying to make this point but: if one were to code in the above paradigm, and also throw some srfi-9000 syntactic sugar at it, one might be able to get something that resembled ocaml/haskell type declarations. And, for the code that I deal with, this might be the bees knees. --linas