Hi Martin,

On Tue, Jun 21, 2011 at 12:17 PM, Martin Hamant <[email protected]> wrote:
>> But in this code you're only changing the local definition of the
>> variable out, not changing the object it denotes. You're only stacking
>> up new definitions of out, each new definition being bound to a value
>> built from the value of the previous binding.
>
> Can we say that:  each time, the new out contains a new updated object
> definition. The goal is to get a complete 'fun' object (ie: out should
> defines the final working function type)?

Yes, that's it.

> super =
> if something then
> (...)
> end
>
> nothing explicitly shows that the if statement is somehow linked to "super"
> !!! that "super=" starts something that the next "end" will finish.
> for the common reader like me, this are two independent things at first.

Good point. I should have foreseen this syntax problem. In fact I
should have used the "def" notation. In general "x = e" can be written
"def x = e end" (where the "=" is actually optional), and for
functions "x = fun(...)->e" can be written "def x(...) = e". So a
clearer way to write the above example would be:

  def super =
    if something then
      ...
    else
      ...
    end
  end

> It is unusual concepts for the end user !! I think it should be easy for the
> one who has worked a lot of time with it.
> I am sure they are reasons for this choice, but I can say, this is really
> not for the end user. With pros and cons it implies :D

I would say that you're not an (average) end user anymore: you're
doing liquidsoap meta-programming in a sense, somehow generating
scripts dynamically.

I believe that liquidsoap is sufficiently simple for simple needs:
many people use it without knowing anything about programming. It gets
more complex when you need to do complex stuff, then you usually have
to understand a few things. It's kind of a trap: smooth learning curve
at first, with a sudden peak :) This is at least partly needed:
liquidsoap wouldn't be that flexible if it wasn't a programming
language. Then one could argue that we should have re-used an existing
language, or that we should not have used static typing... but I'm
still convinced by our choices.

Cheers,
-- 
David

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to