Hmm does'nt Jonathan used curly braces in this particular thread to
mean "optional", not curly braces?
Your post seems to use curly braces as curly braces :-)
So if I understand correctly, Jonathan propose the ocaml syntax, plus
a terminal "end".
let light_pos = [|-20.0; 20.0; 10.0; 1.0|]
and light_diffuse = [|1.0; 1.0; 0.9; 1.0|]
and light_specular = [|1.0; 1.0; 0.9; 1.0|]
and light_ambient = [|0.15; 0.15; 0.15; 1.0|] in
do {
glLightfv gl_light0 gl_position light_pos;
glLightfv gl_light0 gl_diffuse light_diffuse;
glLightfv gl_light0 gl_specular light_specular;
glLightfv gl_light0 gl_ambient light_ambient;
}
end
I'm not sure about the "end" in this case.
Writing it otherwise would gives:
do {
let light_pos = [|-20.0; 20.0; 10.0; 1.0|] in
glLightfv gl_light0 gl_position light_pos;
let light_diffuse = [|1.0; 1.0; 0.9; 1.0|] in
glLightfv gl_light0 gl_diffuse light_diffuse;
let light_specular = [|1.0; 1.0; 0.9; 1.0|] in
glLightfv gl_light0 gl_specular light_specular;
let light_ambient = [|0.15; 0.15; 0.15; 1.0|] in
glLightfv gl_light0 gl_ambient light_ambient;
}
a lot of "let in" repeted.
On Thu, Mar 5, 2009 at 7:03 PM, Rick R <[email protected]> wrote:
> I rather like
> let { binding and binding and binding in EXPR}
>
> or let binding
> binding
> binding
> in EXPR
>
>
> This leaves no question in the reader's mind about the scope of the
> variables. It is explicit that all variables share the same scope, which is
> the intent here, isn't it?
>
> If you want nested levels of scope, then put another let block in the EXPR.
>
> This is basically Haskell syntax, perhaps I'm already showing by bias.
>
>
> On Thu, Mar 5, 2009 at 12:36 PM, Jonathan S. Shapiro <[email protected]>
> wrote:
>>
>> Binding forms that introduce inner scopes should be distinct from
>> those that merely append definitions to the current scope. I do
>> understand that appending actually does introduce a new scope. The
>> issue is that in one type of form the scopes end in the same place,
>> where in the other they do not.
>>
>> I'm currently inclined to favor a syntax very similar to OCaml:
>>
>> let BINDING { and BINDING } in EXPR end
>>
>> and other forms similarly.
>>
>>
>> Strong objections or alternatives?
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev