POV-Ray : Newsgroups : povray.off-topic : I found this interesting Server Time
1 Oct 2024 15:21:38 EDT (-0400)
  I found this interesting (Message 135 to 144 of 154)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: St 
Subject: Re: I found this interesting
Date: 9 Apr 2008 17:44:32
Message: <47fd38c0$1@news.povray.org>
"Fredrik Eriksson" <fe79}--at--{yahoo}--dot--{com> wrote in message 
news:op.### [at] e6600bredbandsbolagetse...
> On Wed, 09 Apr 2008 22:39:53 +0200, Orchid XP v8 <voi### [at] devnull> wrote:
>> Question: is "comelia" a word?
>
> "Comelia" is a name.

    Ah, ok, so perhaps the lyrics went: "Karma, karma, karma Comelia"?

     Very possible.

      ~Steve~


>
>
> -- 
> FE


Post a reply to this message

From: Sabrina Kilian
Subject: Re: I found this interesting
Date: 9 Apr 2008 22:09:08
Message: <47fd76c4$1@news.povray.org>
St. wrote:
  >     Ah, ok, so perhaps the lyrics went: "Karma, karma, karma Comelia"?
> 
>      Very possible.
> 
>       ~Steve~

Or "Karma Chameleon".







Wait, why am I admitting to remembering this song?


Post a reply to this message

From: Darren New
Subject: Re: I found this interesting
Date: 10 Apr 2008 00:25:43
Message: <47fd96c7$1@news.povray.org>
Orchid XP v8 wrote:
>> Erlang has first-class functions as well as closures. Indeed, there 
>> are warnings in the docs saying things like "take care if you store a 
>> closure in a database that when you fetch it back out to run it, 
>> you're running the same version of the interpreter." :-)
> 
> Ooo. So much for "you can upgrade stuff in-place without shutting down". 
> :-P

Heh. Well, you know, I don't think you can actually upgrade the 
interpreter itself without shutting down the node you're running on. On 
the other hand, you could in theory start up a new interpreter, ship the 
running stuff over to it, then shut down the old one.

Upgrading without shutting anything down is easier when it's only Erlang 
code you're upgrading, and not the VM itself, but you *can* do it with 
enough forethought.

> [Mind you, persistent *closures*? That's got to be a fairly rarely used 
> feature...]

Yah.  That they even mention it boggles my mind.

> The I/O monad is unusual as monads go, but essentially the I/O functions 
> return I/O command objects instead of actually *performing* I/O, 

Yeah, that I figured out. I'm just trying to wrap my head around how 
that would work with (say) the clock, or the status of whether your ISP 
is currently screwy, or something like that, just in terms of 
"referential transparency".

I'm trying to figure out conceptually how you represent "the clock" for 
example in a way that it's "referentially transparent".  Or can you not 
actually do that, and that's the point of a monad?

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

From: St 
Subject: Re: I found this interesting
Date: 10 Apr 2008 01:12:20
Message: <47fda1b4$1@news.povray.org>
"Sabrina Kilian" <"ykgp at vtSPAM.edu"> wrote in message 
news:47fd76c4$1@news.povray.org...
> St. wrote:
>  >     Ah, ok, so perhaps the lyrics went: "Karma, karma, karma Comelia"?
>>
>>      Very possible.
>>
>>       ~Steve~
>
> Or "Karma Chameleon".

  LOL! That's it!

> Wait, why am I admitting to remembering this song?

  I know, I can't stand it either...

     ~Steve~


Post a reply to this message

From: Invisible
Subject: Re: I found this interesting
Date: 10 Apr 2008 04:31:27
Message: <47fdd05f$1@news.povray.org>
>> [Mind you, persistent *closures*? That's got to be a fairly rarely 
>> used feature...]
> 
> Yah.  That they even mention it boggles my mind.

5th rule of software design: If it's technically possible to use your 
product in a certain way, somebody will try to actually use it that way.

You *know* this to be true! ;-)

>> The I/O monad is unusual as monads go, but essentially the I/O 
>> functions return I/O command objects instead of actually *performing* 
>> I/O, 
> 
> Yeah, that I figured out. I'm just trying to wrap my head around how 
> that would work with (say) the clock, or the status of whether your ISP 
> is currently screwy, or something like that, just in terms of 
> "referential transparency".
> 
> I'm trying to figure out conceptually how you represent "the clock" for 
> example in a way that it's "referentially transparent".  Or can you not 
> actually do that, and that's the point of a monad?

I'm going to go with "you can't - hence the monad".

The "get time" function just returns an I/O command object. You can 
replace that function call with the command object it returns and the 
meaning of the program is left completely unchanged. Thus it is 
referentially transparent.

The Haskell runtime actually *gets* the clock time, and it does this 
theoretically "after" the Haskell code has already been run and 
generated its giant command object, so...

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


Post a reply to this message

From: Invisible
Subject: Re: I found this interesting
Date: 10 Apr 2008 04:32:36
Message: <47fdd0a4$1@news.povray.org>
Sabrina Kilian wrote:

> Or "Karma Chameleon".
> Wait, why am I admitting to remembering this song?

 >:-D Hahahaha!

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


Post a reply to this message

From: Bill Pragnell
Subject: Re: I found this interesting
Date: 10 Apr 2008 06:03:45
Message: <47fde601$1@news.povray.org>
Darren New wrote:
> There are strict rules, tho.

Looking down this list, it seems I'm aware of these on an instinctive 
level. I certainly use commas according to these rules, although I've 
never learnt these rules explicitly. Good to know!

>> Just don't get me started on apostrophes :)
> 
> Angry Bob's Apostrophe Rules!

I'd say the 90% of apostrophe abuse would be avoided if people could 
remember that apostrophes are never, ever, used for pluralising anything.

:)


Post a reply to this message

From: Darren New
Subject: Re: I found this interesting
Date: 10 Apr 2008 13:37:18
Message: <47fe504e@news.povray.org>
Invisible wrote:
> The "get time" function just returns an I/O command object. You can 
> replace that function call with the command object it returns and the 
> meaning of the program is left completely unchanged. Thus it is 
> referentially transparent.

So if I assign the result of "get time" to a variable and use that 
variable in multiple places, do I get the same time each place I use it, 
or different times?  I think that's what's confusing me.

   S = get_time()
   print(S)
   do_long_task()
   print(S)

I would think you *want* that to do something different from
   print(get_time())
   do_long_task()
   print(get_time())

How would I write each of those in Haskell?


-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

From: Orchid XP v8
Subject: Re: I found this interesting
Date: 10 Apr 2008 15:48:04
Message: <47fe6ef4$1@news.povray.org>
Darren New wrote:
> Invisible wrote:
>> The "get time" function just returns an I/O command object. You can 
>> replace that function call with the command object it returns and the 
>> meaning of the program is left completely unchanged. Thus it is 
>> referentially transparent.
> 
> So if I assign the result of "get time" to a variable and use that 
> variable in multiple places, do I get the same time each place I use it, 
> or different times?  I think that's what's confusing me.

The key is "using".

Recall that the *only* way to *execute* an I/O action is to return it 
from the "main" function. And, since you can only return a single 
action, it's how you splice each mini-action into the giant-action 
returned by "main" that counts. ;-)

If you splice in two copies of the self same action, that action gets 
executed twice. It's that simple.

>   S = get_time()
>   print(S)
>   do_long_task()
>   print(S)
> 
> I would think you *want* that to do something different from
>   print(get_time())
>   do_long_task()
>   print(get_time())
> 
> How would I write each of those in Haskell?

In Haskell, if you use the monadic "do" notation, then the syntax for 
executing an action and putting its result into a variable is

   do
     ...
     x <- do_stuff
     ...

This is technically equivilent to

   ... do_stuff >>= \x -> ...

but less messy on paper. In your case, what you're trying to do is simply

   do
     t1 <- get_time
     print t1

     do_long_task

     t2 <- get_time
     print t2

as opposed to something like

   do
     s <- get_time
     print s
     do_long_task
     print s

which just serves no useful purpose at all. Notice that it's the "<-" 
that says "execute this *now*". In the second example, you only execute 
the thing once, so it only happens once. It's really quite clear on paper.

In case you care, the desugared equivilents are:

   get_time >>= \t1 -> (print t1 >> do_long_task >> get_time >>= \t2 -> 
print t2))

and

   get_time >>= \s -> (print s >> do_long_task >> print s)

You can see why people prefer the "do" notation...

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


Post a reply to this message

From: Darren New
Subject: Re: I found this interesting
Date: 10 Apr 2008 17:26:22
Message: <47fe85fe$1@news.povray.org>
Orchid XP v8 wrote:
> You can see why people prefer the "do" notation...

Yah. :-) I'll have to ponder this s'more.

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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