POV-Ray : Newsgroups : povray.off-topic : Really epic Server Time
14 Oct 2026 23:18:21 EDT (-0400)
  Really epic (Message 1 to 50 of 55)  
Goto Latest 50 Messages Next 5 Messages >>>
From: Invisible
Subject: Really epic
Date: 14 Feb 2008 09:40:57
Message: <47b452f9$1@news.povray.org>
http://hpaste.org/5637

I have no idea whether this is actually executable or whether it does 
anything interesting, but somebody *clearly* has a lot of free time on 
their hands....

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


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Really epic
Date: 14 Feb 2008 10:07:08
Message: <47b4591c@news.povray.org>
Invisible escribió:
> I have no idea whether this is actually executable or whether it does 
> anything interesting, but somebody *clearly* has a lot of free time on 
> their hands....
> 

You haven't seen the International Obfuscated C Code Contest, have you?


Post a reply to this message

From: Warp
Subject: Re: Really epic
Date: 14 Feb 2008 10:09:21
Message: <47b459a1@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> http://hpaste.org/5637

> I have no idea whether this is actually executable or whether it does 
> anything interesting, but somebody *clearly* has a lot of free time on 
> their hands....

  What language is that?

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: Really epic
Date: 14 Feb 2008 10:12:01
Message: <47b45a41$1@news.povray.org>
Warp wrote:

>   What language is that?

It parses as valid Haskell. I have no idea what in the name of God it 
actually does...

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


Post a reply to this message

From: Invisible
Subject: Re: Really epic
Date: 14 Feb 2008 10:15:10
Message: <47b45afe$1@news.povray.org>
Nicolas Alvarez wrote:

> You haven't seen the International Obfuscated C Code Contest, have you?

Yeah, I have. IIRC, there was a program there in the shape of a 
character from Tolkin Elvish, which, when run, prints out the Elvish 
character set. Or. Something.

See also:

http://www.haskell.org/haskellwiki/Obfuscation

Obfuscated for sure. But not as impressive, somehow...

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


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Really epic
Date: 14 Feb 2008 10:20:45
Message: <47b45c4d$1@news.povray.org>
Invisible escribió:
> Warp wrote:
> 
>>   What language is that?
> 
> It parses as valid Haskell. I have no idea what in the name of God it 
> actually does...
> 

Well, if you look at it from a distance, it reads "RSA". So that gives 
you a hint.


Post a reply to this message

From: Invisible
Subject: Re: Really epic
Date: 14 Feb 2008 10:21:53
Message: <47b45c91$1@news.povray.org>
>> It parses as valid Haskell. I have no idea what in the name of God it 
>> actually does...
>>
> 
> Well, if you look at it from a distance, it reads "RSA". So that gives 
> you a hint.

Sure. But given that it defines a bunch of functions called "un", "po" 
and so on... uh...

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


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Really epic
Date: 14 Feb 2008 10:30:05
Message: <47b45e7d$1@news.povray.org>
Invisible escribió:
>>> It parses as valid Haskell. I have no idea what in the name of God it 
>>> actually does...
>>>
>>
>> Well, if you look at it from a distance, it reads "RSA". So that gives 
>> you a hint.
> 
> Sure. But given that it defines a bunch of functions called "un", "po" 
> and so on... uh...
> 

It's not obfuscated if it has readable function names.


Post a reply to this message

From: Invisible
Subject: Re: Really epic
Date: 14 Feb 2008 10:35:15
Message: <47b45fb3$1@news.povray.org>
OK, so I had a go at unscrambling this...



cox n = foldr (\x y -> 128 * y + x) 0 n

de n = un (\x -> (x `mod` 128, x `div` 128), (==0)) n

coll = un (\zs -> (take 35 zs, drop 35 zs), (==""))

pe (n,m) x = s (p (n `div` 2, m) x) `mod` m

p (n,m) x = if n==0
               then 1
               else (if even n then pe (n,m) x else po (n,m) x)

po (n,m) x = (x * p (n-1, m) x) `mod` m

un (f,p) n = if p n then [] else (let (a,b) = f n in a : un (f,p) b)

(g,s) = (\x -> x, \x -> x*x)



That last line is the best. I didn't even realise you could *do* that! 
Very odd...

Right, so, let's do some analysis here.

- "g" is the identity function, and "s" is the square function.

- Apparently "un" is a list unfold function. It takes an integer and a 
pair of functions. The second function tells it when to stop unfolding; 
the first one actually does the unfold.

-- "coll" uses "un" to split a text string into blocks of 25 characters. 
So idea why.

-- "cox" appears to be using a list fold to convert a list into a giant 
code number. (Note that it works with arbitrary precision integers.) 
"de" looks like it's trying to do the reverse operation.

- The "p" function appears to be trying to decide whether to call "pe" 
or "po" depending on whether n is odd or even.

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


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 12:18:15
Message: <47b477d7$1@news.povray.org>
On Thu, 14 Feb 2008 13:07:07 -0200, Nicolas Alvarez wrote:

> Invisible escribió:
>> I have no idea whether this is actually executable or whether it does
>> anything interesting, but somebody *clearly* has a lot of free time on
>> their hands....
>> 
>> 
> You haven't seen the International Obfuscated C Code Contest, have you?

Do they still hold that?  I remember examples from the past of things 
like a morse code translator and a source "picture" that was an ASCII 
train.

Jim


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Really epic
Date: 14 Feb 2008 12:20:38
Message: <47b47866$1@news.povray.org>
Jim Henderson escribió:
> On Thu, 14 Feb 2008 13:07:07 -0200, Nicolas Alvarez wrote:
> 
>> Invisible escribió:
>>> I have no idea whether this is actually executable or whether it does
>>> anything interesting, but somebody *clearly* has a lot of free time on
>>> their hands....
>>>
>>>
>> You haven't seen the International Obfuscated C Code Contest, have you?
> 
> Do they still hold that?  I remember examples from the past of things 
> like a morse code translator and a source "picture" that was an ASCII 
> train.
> 

I remember one that read data from stdin, and outputted it reversed 
(last character first). And the sourcecode of the program compiled if 
you reverted its characters.


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 12:50:55
Message: <47b47f7f$1@news.povray.org>
On Thu, 14 Feb 2008 15:20:37 -0200, Nicolas Alvarez wrote:

> Jim Henderson escribió:
>> On Thu, 14 Feb 2008 13:07:07 -0200, Nicolas Alvarez wrote:
>> 
>>> Invisible escribió:
>>>> I have no idea whether this is actually executable or whether it does
>>>> anything interesting, but somebody *clearly* has a lot of free time
>>>> on their hands....
>>>>
>>>>
>>> You haven't seen the International Obfuscated C Code Contest, have
>>> you?
>> 
>> Do they still hold that?  I remember examples from the past of things
>> like a morse code translator and a source "picture" that was an ASCII
>> train.
>> 
>> 
> I remember one that read data from stdin, and outputted it reversed
> (last character first). And the sourcecode of the program compiled if
> you reverted its characters.

I remember a couple that were like that - one that when compiled and was 
fed the source code generated another program (in another language, IIRC) 
that could then be compiled and run to translate the code into a third 
language.

Jim


Post a reply to this message

From: Warp
Subject: Re: Really epic
Date: 14 Feb 2008 14:07:47
Message: <47b49182@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Warp wrote:

> >   What language is that?

> It parses as valid Haskell.

  I asked because 'let' sounded to me like an assignment, which is not
functional. (In many languages, eg. afaik lisp and scheme, 'let' is an
explicit variable assignment, and an admitted deviation from pure
functionality.)

-- 
                                                          - Warp


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 14:40:01
Message: <47b49911@news.povray.org>
Warp wrote:

>   I asked because 'let' sounded to me like an assignment, which is not
> functional.

I'm pretty sure you're right about Lisp. But in Haskell, it's not an 
assignment - although it does look like one.

In Haskell, "let" introduced local variables. For example,

   solve2 a b c =
     let det2 = b*b - 4*a*c
         det  = sqrt det2
         a2   = 2*a
     in  [(0-b-det)/a2, (0-b+det)/a2]

Now that looks pretty damn identical to the following JavaScript fragment:

   function solve2(a, b, c)
   {
     var det2 = b*b - 4*a*c;
     var det  = Math.sqrt(det2);
     var a2   = 2*a;
     return Array((0-b-dat)/a2, (0-b+det)/a2));
   }

So what's the difference? Well, let's try this:

   function solve2(a, b, c)
   {
     var det  = Math.sqrt(det2);
     var det2 = b*b - 4*a*c;
     var a2   = 2*a;
     return Array((0-b-dat)/a2, (0-b+det)/a2));
   }

Hmm, that's not going to work properly... However, the corresponding 
Haskell works exactly as before:

   solve2 a b c =
     let det  = sqrt det2
         det2 = b*b - 4*a*c
         a2   = 2*a
     in  [(0-b-det)/a2, (0-b+det)/a2]

So in Haskell, the ordering doesn't matter. But maybe you're not 
convinced yet. OK, well try this:

   foo x y =
     let xs = x : ys
         ys = y : xs
     in  xs

Notice how these definitions are muturally recursive. No matter which 
way round you write this in JavaScript, it won't work properly:

   function foo(x,y)
   {
     var xs = new Node(x, ys);
     var ys = new Node(y, xs);
     return xs;
   }

But in Haskell it works just fine, and returns a circular linked list. 
This works exactly because it's a definition, not an assignment.

(You'll also be unsurprised to hear that you're not allowed to define 
the same name twice in a single let-block. But I wanted to emphasize 
that the difference is much deeper than that.)

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


Post a reply to this message

From: nemesis
Subject: Re: Really epic
Date: 14 Feb 2008 14:50:00
Message: <web.47b49a919e92b6c266f20de80@news.povray.org>
whoa!  Haskell is becoming another Perl or Brainf*ck.


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 14:54:37
Message: <47b49c7d@news.povray.org>
nemesis wrote:
> whoa!  Haskell is becoming another Perl or Brainf*ck.

Nah. You can write increadibly cryptic stuff in *any* language. ;-)

I'm sure somebody could come up with some POV-Ray SDL like this if they 
tried hard enough...

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


Post a reply to this message

From: nemesis
Subject: Re: Really epic
Date: 14 Feb 2008 14:55:00
Message: <web.47b49c5b9e92b6c266f20de80@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> (g,s) = (\x -> x, \x -> x*x)
>
> That last line is the best. I didn't even realise you could *do* that!

yes!  very cool!  Looks like Perl/Python 2 way assignment, but of course there's
no assignment here, it's 2 functions defined in the same line by 2 tuples!
Haskell is amazing...

> Very odd...
>
> Right, so, let's do some analysis here.

man, just run this madness and see what it does...


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 14:59:43
Message: <47b49daf$1@news.povray.org>
nemesis wrote:
> Invisible <voi### [at] devnull> wrote:
>> (g,s) = (\x -> x, \x -> x*x)
>>
>> That last line is the best. I didn't even realise you could *do* that!
> 
> yes!  very cool!  Looks like Perl/Python 2 way assignment, but of course there's
> no assignment here, it's 2 functions defined in the same line by 2 tuples!
> Haskell is amazing...

I should have realised that this was possible - I've just never seen it 
at the top-level before.

It's kinda nice to be able to write things like

   (a',b',c',d') = (b,c,d,a)

to do a rotation. All those C programmers are sitting there defining 
temporary variables to handle the shuffle, while I can just tell the 
compiler exactly what I want the end result to be, and it just does it...

Interestingly, the compiler infers some rather strange types for those 
functions. Clearly \x -> x is id, yet the compiler infers a less general 
type than this - presumably due to the tupling. Or perhaps to the other 
call sites in the program, I'm not sure...

>> Very odd...
>>
>> Right, so, let's do some analysis here.
> 
> man, just run this madness and see what it does...

And how do you suggest I do that, given that there's no obvious "entry 
point"?

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


Post a reply to this message

From: nemesis
Subject: Re: Really epic
Date: 14 Feb 2008 15:00:01
Message: <web.47b49cfe9e92b6c266f20de80@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
> It's not obfuscated if it has readable function names.

I don't think readable means much when all you get is "un" or "po".  You could
change those for kanji and it'd make about as much sense...

of course, you could try to guess:  perhaps "un" is to unfoo something and "po"
to position something.  not much better...


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 15:02:23
Message: <47b49e4f$1@news.povray.org>
On Thu, 14 Feb 2008 14:46:25 -0500, nemesis wrote:

> Brainf*ck.

Now there's a language I'm unfamiliar with - who wrote the book on that 
one? ;-)

Jim


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:02:38
Message: <47b49e5e@news.povray.org>
Invisible wrote:

> -- "coll" uses "un" to split a text string into blocks of 25 characters. 
> So idea why.

Well *obviously* I actually meant to type 35...

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


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:03:29
Message: <47b49e91@news.povray.org>
>> Brainf*ck.
> 
> Now there's a language I'm unfamiliar with - who wrote the book on that 
> one? ;-)

As the name suggests, it's a language specifically designed to be 
incomprehensible. [Unlike, say, the SKI calculus, which *is* 
incomprehensible, but not by design...]

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


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 15:05:45
Message: <47b49f19$1@news.povray.org>
On Thu, 14 Feb 2008 20:02:40 +0000, Orchid XP v7 wrote:

> Invisible wrote:
> 
>> -- "coll" uses "un" to split a text string into blocks of 25
>> characters. So idea why.
> 
> Well *obviously* I actually meant to type 35...

What, even with separate keys on the keyboard? <scnr> <g>

Jim


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 15:06:22
Message: <47b49f3e@news.povray.org>
On Thu, 14 Feb 2008 20:03:31 +0000, Orchid XP v7 wrote:

>>> Brainf*ck.
>> 
>> Now there's a language I'm unfamiliar with - who wrote the book on that
>> one? ;-)
> 
> As the name suggests, it's a language specifically designed to be
> incomprehensible. [Unlike, say, the SKI calculus, which *is*
> incomprehensible, but not by design...]

Well, yes, but at the same time, there must be a definitive reference on 
it.  Or is it the "ipsum lorem" text that's considered definitive? ;-)

Jim


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:06:37
Message: <47b49f4d$1@news.povray.org>
>> Well *obviously* I actually meant to type 35...
> 
> What, even with separate keys on the keyboard? <scnr> <g>

Care to count how many characters I typed *correctly*? ;-)

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


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 15:07:41
Message: <47b49f8d$1@news.povray.org>
On Thu, 14 Feb 2008 20:06:39 +0000, Orchid XP v7 wrote:

>>> Well *obviously* I actually meant to type 35...
>> 
>> What, even with separate keys on the keyboard? <scnr> <g>
> 
> Care to count how many characters I typed *correctly*? ;-)

Nah, I just couldn't resist the temptation to call you on it. ;-)

Jim


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:08:34
Message: <47b49fc2$1@news.povray.org>
>> As the name suggests, it's a language specifically designed to be
>> incomprehensible. [Unlike, say, the SKI calculus, which *is*
>> incomprehensible, but not by design...]
> 
> Well, yes, but at the same time, there must be a definitive reference on 
> it.  Or is it the "ipsum lorem" text that's considered definitive? ;-)

Oh yes, of course...

http://www.muppetlabs.com/~breadbox/bf/

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


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Really epic
Date: 14 Feb 2008 15:15:53
Message: <47b4a179@news.povray.org>
Orchid XP v7 escribió:
> So what's the difference? Well, let's try this:
> 
>   function solve2(a, b, c)
>   {
>     var det  = Math.sqrt(det2);
>     var det2 = b*b - 4*a*c;
>     var a2   = 2*a;
>     return Array((0-b-dat)/a2, (0-b+det)/a2));
>   }
> 
> Hmm, that's not going to work properly... However, the corresponding 
> Haskell works exactly as before:
> 
>   solve2 a b c =
>     let det  = sqrt det2
>         det2 = b*b - 4*a*c
>         a2   = 2*a
>     in  [(0-b-det)/a2, (0-b+det)/a2]
> 
> So in Haskell, the ordering doesn't matter.

http://rinkworks.com/stupid/cs_programming.shtml

"An introductory programming student once asked me to look at his 
program and figure out why it was always churning out zeroes as the 
result of a simple computation. I looked at the program, and it was 
pretty obvious:

begin
     readln("Number of Apples", apples);
     readln("Number of Carrots", carrots);
     readln("Price for 1 Apple", a_price);
     readln("Price for 1 Carrot", c_price);
     writeln("Total for Apples", a_total);
     writeln("Total for Carrots", c_total);
     writeln("Total", total);
     total := a_total + c_total;
     a_total := apples * a_price;
     c_total := carrots + c_price;
end;

  * Me: "Well, your program can't print correct results before they're 
computed."
  * Him: "Huh? It's logical what the right solution is, and the computer 
should reorder the instructions the right way."

---

So he was right after all...


Post a reply to this message

From: Warp
Subject: Re: Really epic
Date: 14 Feb 2008 15:20:02
Message: <47b4a272@news.povray.org>
Orchid XP v7 <voi### [at] devnull> wrote:
> >> Brainf*ck.
> > 
> > Now there's a language I'm unfamiliar with - who wrote the book on that 
> > one? ;-)

> As the name suggests, it's a language specifically designed to be 
> incomprehensible.

  Personally I like the idea behind Befunge more. The only problem I have
with Befunge is that it's way too difficult to do anything practical with
it (because it uses a stack which you can't index, and it lacks support
for variables).

-- 
                                                          - Warp


Post a reply to this message

From: nemesis
Subject: Re: Really epic
Date: 14 Feb 2008 15:25:01
Message: <web.47b4a3259e92b6c266f20de80@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   I asked because 'let' sounded to me like an assignment, which is not
> functional.

it introduces a new lexically scoped binding for a constant "function".  It's
not like you can't give values names in functional languages.  Come on, giving
names is the simplest means of abstraction there is!

Assignment is only bad when it happens all the time, at all levels, by multiple
points in code mutating a single location, which can lead to undesired
side-effects as the source of many bugs and sync problems.  As a rule of thumb,
in functional languages new locations are created rather than altering the
contents of previous ones, unless when it's not wise on the performance side.


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:26:47
Message: <47b4a407$1@news.povray.org>
>> So in Haskell, the ordering doesn't matter.
> 
> http://rinkworks.com/stupid/cs_programming.shtml
> 
> "An introductory programming student once asked me to look at his 
> program and figure out why it was always churning out zeroes as the 
> result of a simple computation. I looked at the program, and it was 
> pretty obvious:
> 
> begin
>     readln("Number of Apples", apples);
>     readln("Number of Carrots", carrots);
>     readln("Price for 1 Apple", a_price);
>     readln("Price for 1 Carrot", c_price);
>     writeln("Total for Apples", a_total);
>     writeln("Total for Carrots", c_total);
>     writeln("Total", total);
>     total := a_total + c_total;
>     a_total := apples * a_price;
>     c_total := carrots + c_price;
> end;
> 
>  * Me: "Well, your program can't print correct results before they're 
> computed."
>  * Him: "Huh? It's logical what the right solution is, and the computer 
> should reorder the instructions the right way."
> 
> ---
> 
> So he was right after all...

The trouble is, as soon as you start assigning more than one value to 
something, it suddenly matters *when* you read it's value. And that 
means if you start reordering things, everything goes horribly wrong.

Haskell does not permit you to assign more than one value to any given 
variable. Thus, Haskell is able to chase down dependencies (even 
circular ones) and Do The Right Thing(tm). So it really is a math-style 
definition that always holds rather than an imperative-style assignment 
at a specific point in time.

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


Post a reply to this message

From: Warp
Subject: Re: Really epic
Date: 14 Feb 2008 15:29:41
Message: <47b4a4b5@news.povray.org>
Orchid XP v7 <voi### [at] devnull> wrote:
>    solve2 a b c =
>      let det  = sqrt det2
>          det2 = b*b - 4*a*c
>          a2   = 2*a
>      in  [(0-b-det)/a2, (0-b+det)/a2]

  I wonder what something along the lines of this would do:

foo a =
  let res = if a<2 then 1 else a*foo(a-1)
  in res

-- 
                                                          - Warp


Post a reply to this message

From: nemesis
Subject: Re: Really epic
Date: 14 Feb 2008 15:30:00
Message: <web.47b4a3a79e92b6c266f20de80@news.povray.org>
Orchid XP v7 <voi### [at] devnull> wrote:
> >   I asked because 'let' sounded to me like an assignment, which is not
> > functional.
>
> I'm pretty sure you're right about Lisp. But in Haskell, it's not an
> assignment - although it does look like one.

In Scheme and Lisp, let introduces new lexical scoped bindings for values, just
like in Haskell.  Except someone can use set! on them and break all referential
transparency apart...


Post a reply to this message

From: nemesis
Subject: Re: Really epic
Date: 14 Feb 2008 15:30:00
Message: <web.47b4a49d9e92b6c266f20de80@news.povray.org>
Orchid XP v7 <voi### [at] devnull> wrote:
> And how do you suggest I do that, given that there's no obvious "entry
> point"?

run one of them, perhaps "un", on some RSA key?


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:30:38
Message: <47b4a4ee$1@news.povray.org>
Nicolas Alvarez wrote:

> http://rinkworks.com/stupid/cs_programming.shtml

Woah. Some of these are pretty "special" BTW... :-D

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


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:31:22
Message: <47b4a51a$1@news.povray.org>
nemesis wrote:
> Orchid XP v7 <voi### [at] devnull> wrote:
>>>   I asked because 'let' sounded to me like an assignment, which is not
>>> functional.
>> I'm pretty sure you're right about Lisp. But in Haskell, it's not an
>> assignment - although it does look like one.
> 
> In Scheme and Lisp, let introduces new lexical scoped bindings for values, just
> like in Haskell.  Except someone can use set! on them and break all referential
> transparency apart...

Ah, OK.

IIRC there's also a bunch of functions for modifying lists in-place that 
Haskell also doesn't have...

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


Post a reply to this message

From: Warp
Subject: Re: Really epic
Date: 14 Feb 2008 15:33:08
Message: <47b4a583@news.povray.org>
nemesis <nam### [at] gmailcom> wrote:
> In Scheme and Lisp, let introduces new lexical scoped bindings for values, just
> like in Haskell.  Except someone can use set! on them and break all referential
> transparency apart...

  Maybe I confused "let" with "set".

-- 
                                                          - Warp


Post a reply to this message

From: nemesis
Subject: Re: Really epic
Date: 14 Feb 2008 15:35:00
Message: <web.47b4a5b79e92b6c266f20de80@news.povray.org>
Jim Henderson <nos### [at] nospamcom> wrote:
> Well, yes, but at the same time, there must be a definitive reference on
> it.  Or is it the "ipsum lorem" text that's considered definitive? ;-)

googled:
http://www.muppetlabs.com/~breadbox/bf/

I don't lose time with that kind of stuff...


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:35:18
Message: <47b4a606$1@news.povray.org>
Warp wrote:

>   I wonder what something along the lines of this would do:
> 
> foo a =
>   let res = if a<2 then 1 else a*foo(a-1)
>   in res

Looks like YAFFI [Yet Another Factorial Function] to me. ;-)

[And yes, for anybody else reading it, it works just fine...]

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


Post a reply to this message

From: nemesis
Subject: Re: Really epic
Date: 14 Feb 2008 15:40:00
Message: <web.47b4a67c9e92b6c266f20de80@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:
> begin
>      readln("Number of Apples", apples);
>      readln("Number of Carrots", carrots);
>      readln("Price for 1 Apple", a_price);
>      readln("Price for 1 Carrot", c_price);
>      writeln("Total for Apples", a_total);
>      writeln("Total for Carrots", c_total);
>      writeln("Total", total);
>      total := a_total + c_total;
>      a_total := apples * a_price;
>      c_total := carrots + c_price;
> end;
>
>   * Me: "Well, your program can't print correct results before they're
> computed."
>   * Him: "Huh? It's logical what the right solution is, and the computer
> should reorder the instructions the right way."

a functional programmer with no prior exposure to the imperative paradigm?!
Haskell is creating mindless monsters! :D


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 15:41:49
Message: <47b4a78d$1@news.povray.org>
nemesis wrote:

> a functional programmer with no prior exposure to the imperative paradigm?!
> Haskell is creating mindless monsters! :D

Hey, this was probably a long time ago! Maybe he was a Prolog 
programmer? ;-)

*runs*

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


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 16:21:57
Message: <47b4b0f5$1@news.povray.org>
On Thu, 14 Feb 2008 15:33:59 -0500, nemesis wrote:

> Jim Henderson <nos### [at] nospamcom> wrote:
>> Well, yes, but at the same time, there must be a definitive reference
>> on it.  Or is it the "ipsum lorem" text that's considered definitive?
>> ;-)
> 
> googled:
> http://www.muppetlabs.com/~breadbox/bf/
> 
> I don't lose time with that kind of stuff...

I think you just broke my brain.  And here I was thinking it was a joke 
you made up. :-)

Jim


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 16:22:18
Message: <47b4b10a$1@news.povray.org>
On Thu, 14 Feb 2008 20:08:36 +0000, Orchid XP v7 wrote:

>>> As the name suggests, it's a language specifically designed to be
>>> incomprehensible. [Unlike, say, the SKI calculus, which *is*
>>> incomprehensible, but not by design...]
>> 
>> Well, yes, but at the same time, there must be a definitive reference
>> on it.  Or is it the "ipsum lorem" text that's considered definitive?
>> ;-)
> 
> Oh yes, of course...
> 
> http://www.muppetlabs.com/~breadbox/bf/

Now I *have* seen it all. :-)

Jim


Post a reply to this message

From: Orchid XP v7
Subject: Re: Really epic
Date: 14 Feb 2008 16:23:48
Message: <47b4b164@news.povray.org>
Jim Henderson wrote:

> I think you just broke my brain.

Does exactly what it says on the tin.

> And here I was thinking it was a joke you made up. :-)

Oh no, it's definitely not a joke. ;-)

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


Post a reply to this message

From: Nicolas Alvarez
Subject: Re: Really epic
Date: 14 Feb 2008 16:27:11
Message: <47b4b22f$1@news.povray.org>
Jim Henderson escribió:
> On Thu, 14 Feb 2008 15:33:59 -0500, nemesis wrote:
>> googled:
>> http://www.muppetlabs.com/~breadbox/bf/
>>
>> I don't lose time with that kind of stuff...
> 
> I think you just broke my brain.

You mean he f**ked your brain?


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 16:30:35
Message: <47b4b2fb$1@news.povray.org>
On Thu, 14 Feb 2008 21:23:49 +0000, Orchid XP v7 wrote:

> Jim Henderson wrote:
> 
>> I think you just broke my brain.
> 
> Does exactly what it says on the tin.

It's tinned, to?  Wow. :-)

>> And here I was thinking it was a joke you made up. :-)
> 
> Oh no, it's definitely not a joke. ;-)

Well, for some values of 'joke' anyways. ;-)

Jim


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 14 Feb 2008 16:30:44
Message: <47b4b304$1@news.povray.org>
On Thu, 14 Feb 2008 19:27:10 -0200, Nicolas Alvarez wrote:

> Jim Henderson escribió:
>> On Thu, 14 Feb 2008 15:33:59 -0500, nemesis wrote:
>>> googled:
>>> http://www.muppetlabs.com/~breadbox/bf/
>>>
>>> I don't lose time with that kind of stuff...
>> 
>> I think you just broke my brain.
> 
> You mean he f**ked your brain?

More or less, yes.

Jim


Post a reply to this message

From: Invisible
Subject: Re: Really epic
Date: 15 Feb 2008 04:15:31
Message: <47b55833@news.povray.org>
Orchid XP v7 wrote:

> Looks like YAFFI [Yet Another Factorial Function] to me. ;-)

Yet Another Factorial Function Implementation.

Damn it, I should just stop typing! >_<

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


Post a reply to this message

From: Invisible
Subject: Re: Really epic
Date: 15 Feb 2008 04:16:15
Message: <47b5585f@news.povray.org>
Jim Henderson wrote:

> Now I *have* seen it all. :-)

Nah. The Iota calculus is much harder. ;-)

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


Post a reply to this message

From: Jim Henderson
Subject: Re: Really epic
Date: 15 Feb 2008 12:52:30
Message: <47b5d15e$1@news.povray.org>
On Fri, 15 Feb 2008 09:16:14 +0000, Invisible wrote:

> Jim Henderson wrote:
> 
>> Now I *have* seen it all. :-)
> 
> Nah. The Iota calculus is much harder. ;-)

I gave up at integral calculus.  Too much memorisation.

Jim


Post a reply to this message

Goto Latest 50 Messages Next 5 Messages >>>

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