On 11/6/13 10:38 AM, Oren Ben-Kiki wrote:
Coming from Haskell, I realize some of the background of using this
syntax form. But looking at my code, I sometimes wish I could just write
`x: Foo := foo();` instead of `let x: Foo = foo();`. All these `let`s in
the code seem noisy. I suppose this was a
I didn't consider that; `pattern := expression` would require "infinite
lookahead" in the parser, I guess. Good point.
Thanks!
On Wed, Nov 6, 2013 at 8:56 PM, Patrick Walton wrote:
> `let` tells the parser that there's a pattern coming up.
>
> Languages that do 'x := whatever' can never have de
On Wed, Nov 6, 2013 at 10:38 AM, Oren Ben-Kiki wrote:
> Coming from Haskell, I realize some of the background of using this syntax
> form. But looking at my code, I sometimes wish I could just write `x: Foo :=
> foo();` instead of `let x: Foo = foo();`. All these `let`s in the code seem
> noisy. I
Coming from Haskell, I realize some of the background of using this syntax
form. But looking at my code, I sometimes wish I could just write `x: Foo
:= foo();` instead of `let x: Foo = foo();`. All these `let`s in the code
seem noisy. I suppose this was an explicit design decision - I wonder if
any
On Tue, Nov 05, 2013 at 08:53:45PM -0800, Ziad Hatahet wrote:
> This relieves one form writing wrapper classes in order for certain
> structs to adhere to particular interfaces.
Partially, yes. Where this breaks down is if you have a type from one
crate and an interface from another. We can't help
On 06/11/13 18:46, spir wrote:
I can write this:
struct Points {xs:~[uint], ys:~[uint]}
fn main () {
let mut ps = Points{xs:~[1u], ys:~[1u]};
...
}
But I cannot write that:
struct Points {xs:~[T], ys:~[T]}
fn main () {
let mut ps = Points{xs:~[1u], ys:~[
I would think:
let mut ps = *Points* {xs:~[1], ys:~[1]};
let mut ps : *Points* = *Points* {xs:~[1], ys:~[1]};
In Haskell-speak, there is a different between the "type" and the
"constructor", even though by convention they are given the same name.
On Wed, Nov 6, 2013 at 9:46 AM, spir wrote:
>