POV-Ray : Newsgroups : povray.off-topic : GIMP hotkeys/ scripts/ user-defined functions? Server Time
6 Sep 2024 21:19:28 EDT (-0400)
  GIMP hotkeys/ scripts/ user-defined functions? (Message 21 to 30 of 80)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: Re: GIMP hotkeys/ scripts/ user-defined functions?
Date: 10 Dec 2008 11:29:16
Message: <493fee5c$1@news.povray.org>
nemesis wrote:

> Actually, that example should be perfect for Python/Ruby and their's 
> named arguments.

Don't forget Smalltalk. (Although Smalltalk still requires you to write 
them *in the right order*.)

> 8 friggin' arguments is impossible to remember which 
> is which!  They beat both Haskell and Lisp hands down... :)

Yeah, actually _any_ function that requires 8 distinct arguments is 
probably a bad idea. Probably means you should be splitting it into 
several seperate functions, or joining some of the arguments up into 
more complex data structures, or *something*...


Post a reply to this message

From: nemesis
Subject: Re: GIMP hotkeys/ scripts/ user-defined functions?
Date: 10 Dec 2008 11:29:24
Message: <493fee64$1@news.povray.org>
nemesis escreveu:
> Actually, that example should be perfect for Python/Ruby and their's 
> named arguments.  8 friggin' arguments is impossible to remember which 
> is which!  They beat both Haskell and Lisp hands down... :)

Hmm, actually, Common Lisp has named arguments... but I'm more of a 
Scheme guy... :P


Post a reply to this message

From: Invisible
Subject: Re: GIMP hotkeys/ scripts/ user-defined functions?
Date: 10 Dec 2008 11:30:04
Message: <493fee8c$1@news.povray.org>
nemesis wrote:

> Hmm, actually, Common Lisp has named arguments... but I'm more of a 
> Scheme guy... :P

Are you scheming against me? :-P


Post a reply to this message

From: nemesis
Subject: Re: GIMP hotkeys/ scripts/ user-defined functions?
Date: 10 Dec 2008 11:30:50
Message: <493feeba@news.povray.org>
Invisible escreveu:
>> so, you're example would be:
>>
>> ((o foo1 foo2 foo3 foo4 foo5 foo6) x)
>> foo1 $ foo2 $ foo3 $ foo4 $ foo5 $ foo6 x
>>
>> whoa!  It's shorter! ;)
> 
> What, defining three pages of code is longer than the 1-liner I posted?
> 
> The ($) operator is defined in the Haskell language standard. :-P

The o operator is defined in my personal standard and I never look back. ;)


Post a reply to this message

From: nemesis
Subject: Re: GIMP hotkeys/ scripts/ user-defined functions?
Date: 10 Dec 2008 11:32:54
Message: <493fef36@news.povray.org>
Invisible escreveu:
> nemesis wrote:
> 
>> Hmm, actually, Common Lisp has named arguments... but I'm more of a 
>> Scheme guy... :P
> 
> Are you scheming against me? :-P

I'll plot something... :D


Post a reply to this message

From: nemesis
Subject: Re: GIMP hotkeys/ scripts/ user-defined functions?
Date: 10 Dec 2008 11:36:56
Message: <493ff028@news.povray.org>
Darren New escreveu:
> nemesis wrote:
>> (o inc sqr inc) 
> 
> This level of notation, without the parens, is where I always get lost 
> trying to understand SML. The presence of parens shows what's an 
> argument and what's a function, in ways that mixing binary and unary 
> operators that are spelled the same way as variables doesn't.

That's a problem with languages that permit such ambiguities.  There 
simply is no ambiguity in Lisp expressions.  Also, Scheme has a single 
namespace for functions and variables, so you can't have a single 
identifier for both and resolve ambiguity by context.  It's a remarkably 
homogenous language.


Post a reply to this message

From: Invisible
Subject: Undirected rambling
Date: 10 Dec 2008 11:37:34
Message: <493ff04e@news.povray.org>
>> What, defining three pages of code is longer than the 1-liner I posted?
>>
>> The ($) operator is defined in the Haskell language standard. :-P
> 
> The o operator is defined in my personal standard and I never look back. ;)

OK, but ($) is still a 1-liner:

   f $ x = f x

And, unlike your notation, it doesn't require any brackets at all! ;-)



BTW, what would you say the most irritating library design flaw in 
Scheme is? In Haskell, my personal one is this:

   filter odd [1, 2, 3, 4]

That takes a list and filters out the odd numbers, right?

WRONG!

It filters out the *even* numbers.

Like, WTF?

Obviously what they *should* have done is name it "select". Then you 
would write

   select odd [1, 2, 3, 4]

and it would be completely obvious what it does. Hey, it works for SQL 
and Smalltalk, why not Haskell? *sigh* I keep thinking that

   filter f = select (not . f)


Post a reply to this message

From: nemesis
Subject: Re: GIMP hotkeys/ scripts/ user-defined functions?
Date: 10 Dec 2008 11:38:10
Message: <493ff072$1@news.povray.org>
Hmm, I wonder if this gregjohn fellow is taking any advantage from my 
replies.  He posts a question and vanishes! O_o


Post a reply to this message

From: Invisible
Subject: Named arguments
Date: 10 Dec 2008 11:40:58
Message: <493ff11a$1@news.povray.org>
nemesis wrote:

> Hmm, actually, Common Lisp has named arguments... but I'm more of a 
> Scheme guy... :P

How about this:

   data Settings = Settings
     {
       time_step :: Time,
       min_subdivide :: Time,
       tolerance :: Space,
       recursive :: Bool
     }

   foo $ Settings {recursive = True, tolerance = 0.01, min_subdivide = 
0.001, time_step = 2.5}

Heh, that's the trouble with named arguments - it gets so verbose. ;-)


Post a reply to this message

From: Invisible
Subject: Re: GIMP hotkeys/ scripts/ user-defined functions?
Date: 10 Dec 2008 11:43:06
Message: <493ff19a$1@news.povray.org>
nemesis wrote:

> http://en.wikipedia.org/wiki/Lisp_(programming_language)#Language_innovations 
> 
> 
> Not that wikipedia is authorithative knowledge... :P
> 
> Until then, all you had was assembly branching.

...there's an XML syntax for Lisp??! o_O

*runs away*


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.