Comment

Comment by xscott

I agree it's weird there's all this syntax talk in a dead thread of a flagged post about a different topic. I guess language (and now community) wars can't help but devolve into this. As for strangeness, all three of these are valid:

    let mut a = Vec::<u32>::new();
    let mut b = <Vec::<u32>>::new();
    let mut c = <Vec<u32>>::new();
but I think most C++ programmers would expect:

    let mut d = Vec<u32>::new();
which is not allowed. Pretend it's a different type, because really you'd just use the vec! macro for this.

Last I looked, there's another oddity in the lexer/parser with a.0.1 coming out as Id(a) DOT F64(0.1) and a later stage recovers the intent Id(a) DOT Int(0) DOT Int(1).

parent xscott 2 days ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton