News for hackers. Stuff that matters.
Re:Apt Rust requirement raises questions by kstrauser on Tuesday November 25, 2025 @01:01PM (#46048631)
> The grammar could've used `Generic[Specific]` with square brackets and avoided the need for the turbo fish.

But then people would grouse about it using left-bracket and right-bracket as brackets in a type "context".

Re:Apt Rust requirement raises questions by GoblinSlayer on Tuesday November 25, 2025 @02:54PM (#46049944)
The problem here is that angle brackets are semantics dependent syntax. Whether they are brackets or not depends on semantic context. Conversely square brackets are always brackets.
Re:Apt Rust requirement raises questions by steveklabnik on Tuesday November 25, 2025 @03:10PM (#46050134)
Square brackets would be semantically dependent if they appeared in the same position of angle brackets. There's nothing magical about [] that makes the problems with <> disappear.
Re:Apt Rust requirement raises questions by GoblinSlayer on Tuesday November 25, 2025 @04:25PM (#46050983)
It disappears the problem that angle brackets are sometimes not brackets. I.e. a<b>c is parsed as (a<b)>c or as (a(<b>))c.
Re:Apt Rust requirement raises questions by xscott on Tuesday November 25, 2025 @04:57PM (#46051285)
It also comes up when you want compile time expressions as parameters to your generics:

    // nice and clean
    let a = Generic[T, A > B]::new(); 

    // gross curlies needed because of poor choices
    let a = Generic::<T, {A > B}>::new();
Re:Apt Rust requirement raises questions by kstrauser on Tuesday November 25, 2025 @03:53PM (#46050645)
So that’s the Specificth element of Generic?
Re:Apt Rust requirement raises questions by GoblinSlayer on Tuesday November 25, 2025 @04:28PM (#46051018)
It's Brackets(Generic,Specific).
Re:Apt Rust requirement raises questions by xscott on Tuesday November 25, 2025 @01:06PM (#46048688)
Lol, yes they would. However, I wouldn't. :-)