Re: [Haskell-cafe] Detecting Cycles in Datastructures

2005-11-19 Thread Jacob Nelson


http://users.info.unicaen.fr/~karczma/arpap/

On Sat, 19 Nov 2005, Gracjan Polak wrote:


2005/11/19, Benjamin Franksen


[You should read some of his papers, for instance the most unreliable
techique in the world to compute pi. I was ROTFL when I saw the title
and reading it was an eye-opener and fun too.]



Care to post a link? Seems interesting, but unknown to google :)

--
Gracjan
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Specify array or list size?

2005-05-07 Thread Jacob Nelson
GCC knows how big an array is:
jake$ cat  arrsizetest.c
#include stdio.h
int main()
{
int a[50];
printf(sizeof a == %d\n,sizeof(a));
return 0;
}
jake$ gcc arrsizetest.c
jake$ ./a.out
sizeof a == 200
jacob
On Sat, 7 May 2005, Thomas Davie wrote:
No, it introduces a variable of type array of 50 ints, which can be
converted to pointer to int.
It matters when you make a pointer of such arrays, an array of such
arrays, or sizeof such array. In C++ the size can be matched by
template parameter, and you can have separate overloadings for
separate array sizes.
I'm not familiar with your C++ example (not being familiar with C++), but I 
think that it's a bit of a stretch of the imagination to say that C 
introduces a variable of type array of 50 ints, the fact that this is now 
an array of 50 integers is never checked at any point in the compilation or 
run, and I'm not sure it can be even if KR had wanted to.  If I'm thinking 
straight then *any* array definition merely gets re-written to a memory 
allocation of the relevant amount of ram, and beyond this point it is forever 
of type pointer to array content type.

As an example:
int bobsArray[5];
bobsArray[6] = 23;
is not badly typed ? it is merely a badly broken program.
Bob
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Specify array or list size?

2005-05-07 Thread Jacob Nelson

On Sat, 7 May 2005, Abraham Egnor wrote:
So does ghc:
...
That doesn't mean the size is part of the *type*.
Sure. I'm just pointing out that
   int a[50];
is not *quite* the same as
   int *a = (int *)malloc(50 * sizeof(int));
jacob
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Comparison with Clean?

2005-05-04 Thread Jacob Nelson

On Wed, 4 May 2005, Benjamin Franksen wrote:
We may have a different copy of SICP, but in mine (2nd edition) there is
Chapter 4.2 Variantions on a Scheme -- Lazy Evaluation and in particular
4.2.2 An Interpreter with Lazy Evaluation.
Here's the direct link:
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-27.html#%_sec_4.2.2
jacob
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread Jacob Nelson


On Thu, 6 Jan 2005, Greg Buchholz wrote:

 As one data point, I don't think SOEGraphics works with GHC or
 recent versions of Hugs (http://www.haskell.org/soe/graphics.htm).

I had trouble with this recently, and a friend of a friend suggested I use
the latest GHC from CVS, and import Graphics.SOE, rather than SOEGraphics.
I ran the original code under GHCi 6.3, importing Graphics.SOE, without
problems.

Jacob Nelson
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe