val a = "abc"f1(a, f2(b, ...) )
f1(@a "abc", f2(a, ..) )
f1(paramName = @a "abc", f2(a, ..) )
I will write you up a code example next time I am in front of a computer. Remind me if I don't soon.
Here is a compileable source file. It contains commentary throughout and hopefully makes the point clearer.
https://gist.github.com/3233807
As it happens, this subject gets a fair amount of exposure in Functional Programming in Scala[ http://www.manning.com/bjarnason/ ], with exercises leading up to this point and also going beyond.
-- Andreas Joseph Krogh<and...@officenet.no> - mob: +47 909 56 963 Senior Software Developer / CEO - OfficeNet AS - http://www.officenet.no Public key: http://home.officenet.no/~andreak/public_key.asc
Is it just my browser or github just can’t break up long lines in their viewer?
It's github.
Try this https://t.co/5PxHuNRr
On Aug 3, 2012 4:25 AM, "Razvan Cojocaru" <p...@razie.com> wrote:
Is it just my browser or github just can�t break up long lines in their viewer?
From: scala...@googlegroups.com [mailto:scala...@googlegroups.com] On Behalf Of Tony Morris
Sent: August-02-12 1:02 AM
To: Tony Morris
Cc: Meglio; scala...@googlegroups.com
Subject: Re: [scala-user] f1(x, f2(x, b) ) - Is there a way to re-use value x without previously declaring it as val x?
�
Here is a compileable source file. It contains commentary throughout and hopefully makes the point clearer.
https://gist.github.com/3233807
As it happens, this subject gets a fair amount of exposure in Functional Programming in Scala[ http://www.manning.com/bjarnason/ ], with exercises leading up to this point and also going beyond.
On 02/08/12 08:39, Tony Morris wrote:I will write you up a code example next time I am in front of a computer. Remind me if I don't soon.
On Aug 1, 2012 11:56 PM, "Meglio" <x.me...@gmail.com> wrote:
Tony, have read your comment 2 times but have not understood it. Any good link to more detailed explanation about SK combinator calculus?
�
Kevin, I'm trying to rewrite f1/f2, but not success yet. Maybe you can get back with some advice (see next).
�
I have bunch of functions for data extraction from HTML.
Each function can throw an exception, but exception text depends on element name being extracted, for example:
�
"result/pos TD is required but not found"
"result/pos can't be longer then 4 symbols"
and so on
�
Then, I combine and call these functions multiple times, passing in element name - so I get clear and fast feedback from crawler:
�
val pos = f1("result / pos", f2("result / pos", ..) )
�
I cannot make an f12(name, param1, ...) - just because I have many f functions and I combine them differently each time, eg:
�
val pos = f1("result / pos", f2("result / pos", ..) )�
val track = f1("result / track", f2("result / track", ..) )
�
Is it clear or nonsense when explained in such way?
�
Also, I'm not sure if using implicit values for "result / pos" is a good idea.
�
�