[plt-scheme] Re: boolean operators on integers

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Jul 12 21:51:59 EDT 2008

On Jul 13, Yavuz Arkun wrote:
> 
> How come computer scientists obsess about segregating things into
> ever finer types when all the other sciences are really about
> finding unifying themes that brings together apparently disparate
> phenomena?

Use javascript for a while.  First time you get 23 as the result of
adding 2 and 3 and things and you'll end up writing "unify" on a piece
of paper and then spend 4 hours burning it.

Here's another puzzle:

  foo = new Array();
  foo.push(1);
  foo.push(23);
  foo.push(345);

We now have `foo' bound to an array of three integers.  If you do this,

  for (var i in foo) alert("i = " + i);

you'll find that `var i in foo' iterates `i' over the indexes.  Odd
but acceptable, right?

Now try this:

  for (var i in foo) alert("i = " + (i+0));


(So where was that piece of paper...)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.