Thanks for the one-line expression. Hence, if I want to assign this new 
function to the existing variable "f" using one line, I can do

f = f1(a,b) = f2(3, a, b)

It will work for me!
Joan

El miércoles, 4 de junio de 2014 11:39:40 UTC+1, Tomas Lycken escribió:
>
> I don't think you can avoid f1 completely, but there is a one-line syntax 
> to obtain the same thing:
>
> f1(a,b) = f2(3,a,b)
>
> I can't imagine a syntax to express that thing that is more compact yet 
> equally expressive.
>
> // T
>
> On Wednesday, June 4, 2014 12:37:47 PM UTC+2, joanenric barcelo wrote:
>>
>> First of all, sorry if the question in the title is not well explained.
>> Basically, what I want to know if some of you guys know a nicer way to do 
>> the following:
>>
>> function f2(a, b, c)
>>  return a+b+c
>> end
>>
>> f = function f1(a,b)
>>  f2(3,a,b)
>> end
>> so
>> f(1,1)
>> is 5
>>
>> What I want to do is to create a new function "f" which is similar to 
>> "f2" but with only two arguments. The first argument is implicit.
>> Anyone knows how f1 can be avoided? Thanks!!
>>
>> Joan
>>
>

Reply via email to