POV-Ray : Newsgroups : povray.off-topic : An explanation of what next_permutation does : Re: An explanation of what next_permutation does Server Time
5 Sep 2024 01:24:29 EDT (-0400)
  Re: An explanation of what next_permutation does  
From: Orchid XP v8
Date: 5 Dec 2009 14:09:17
Message: <4b1aafdd$1@news.povray.org>
Warp wrote:

>   You seriously claiming that if you make a typo in Haskell, it always
> magically knows that and gives you an error message?

What's magic?

If you type something wrong, it might be a syntax error. (Any 
half-decent compiler will catch these.) If you type the wrong name by 
mistake, it's probably a type error. If you assume that a certain list 
will always contain 3 items (for example) and actually it doesn't, 
you'll get an exception when you try to access a non-existent element.

It's not *guaranteed* that all mistakes will be caught. If you 
accidentally write "x + x" instead of "x + y", no error (just the wrong 
result). Same as any other language.

Let's look at this the other way around: There is no typo you can 
possibly make which will result in a segfault. (Unless you're doing 
something *very* special, like calling an external C routine or 
something.) About the worst that can happen is that your program eats 
craploads of RAM or goes into an infinite loop. (Or, if you're using 
explicit concurrency with locks, you might deadlock or something.)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.