~sircmpwn/hare-users

6 5

Switch Puzzling

outlook_245C7DDC74AA9E63@outlook.com <outlook_245C7DDC74AA9E63@outlook.com>
Details
Message ID
<ROAP284MB14565BD947AADE661B4F35F5B4CA9@ROAP284MB1456.BRAP284.PROD.OUTLOOK.COM>
DKIM signature
missing
Download raw message
Sorry,
I think switch design is puzzling, any body could explain it to me why hare not design more strictly, please.

switch(1){
    // break is useless
    case => fmt::printfln("other1")!; // default branch can be put at head
    case 1 => fmt::printfln("1")!;
    case 1 => fmt::printfln("11")!; // two branches could have same condition, but only the first branch can be run
    case 2 => fmt::printfln("2")!;
    case 3 => fmt::printfln("3")!;
    case 4 => fmt::printfln("4")!;
    case 5 => fmt::printfln("5")!;
    case 6 => fmt::printfln("6")!;
    case => fmt::printfln("other2")!;
    case => fmt::printfln("other3")!; // there could have more than one default branch, but only the last deafult branch can be run
};
Details
Message ID
<5bbe7971-8cc1-49a4-a66d-85764d5b065b@sebsite.pw>
In-Reply-To
<ROAP284MB14565BD947AADE661B4F35F5B4CA9@ROAP284MB1456.BRAP284.PROD.OUTLOOK.COM> (view parent)
DKIM signature
pass
Download raw message
The points you brought up about multiple identical cases are unintended, 
I believe. The compiler should check for this and error out in this case, 
and the spec should be updated to reflect that. Thanks for bringing this 
up!

As for breaking out of a switch expression early, the correct way to do 
this is with `yield`. `break` only operates on for loops.
- Sebastian
Details
Message ID
<43564f38-c525-4a77-96bc-6adfd4c09b8c@www.fastmail.com>
In-Reply-To
<5bbe7971-8cc1-49a4-a66d-85764d5b065b@sebsite.pw> (view parent)
DKIM signature
pass
Download raw message
On Fri, May 13, 2022, at 8:18 AM, Sebastian wrote:
> The points you brought up about multiple identical cases are unintended, 
> I believe. The compiler should check for this and error out in this case, 
> and the spec should be updated to reflect that. Thanks for bringing this 
> up!

Looks like the spec (at 6.6.45.4) already says that.

BTW, do users file bug reports in sourcehut? I just went to
<https://git.sr.ht/~sircmpwn/harec> to see if there is a bug report
on this, and I see tabs for "summary", "tree", "log", and "refs", ... but
where's the one for todo (or bug reports, issues, whatev)?
Details
Message ID
<CJYMV6XD64MF.23UBQNW6J1EZK@taiga>
In-Reply-To
<43564f38-c525-4a77-96bc-6adfd4c09b8c@www.fastmail.com> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On Fri May 13, 2022 at 2:27 PM CEST, John Gabriele wrote:
> BTW, do users file bug reports in sourcehut? I just went to
> <https://git.sr.ht/~sircmpwn/harec> to see if there is a bug report
> on this, and I see tabs for "summary", "tree", "log", and "refs", ... but
> where's the one for todo (or bug reports, issues, whatev)?

SourceHut's bug trackers are not associated directly with git
repositories. You can find the project hub here:

https://sr.ht/~sircmpwn/hare

Links to bug trackers and such are provided here.
Details
Message ID
<9b8c846c-3dd2-40f6-a762-a17a52acf130@www.fastmail.com>
In-Reply-To
<CJYMV6XD64MF.23UBQNW6J1EZK@taiga> (view parent)
DKIM signature
pass
Download raw message
On Fri, May 13, 2022, at 8:30 AM, Drew DeVault wrote:
> On Fri May 13, 2022 at 2:27 PM CEST, John Gabriele wrote:
>> BTW, do users file bug reports in sourcehut? I just went to
>> <https://git.sr.ht/~sircmpwn/harec> to see if there is a bug report
>> on this, and I see tabs for "summary", "tree", "log", and "refs", ... but
>> where's the one for todo (or bug reports, issues, whatev)?
>
> SourceHut's bug trackers are not associated directly with git
> repositories. You can find the project hub here:
>
> https://sr.ht/~sircmpwn/hare
>
> Links to bug trackers and such are provided here.

Ah. Thank you.
Details
Message ID
<CJYOQUYHRKXY.XD6Q92GH8NZ3@dog>
In-Reply-To
<CJYMV6XD64MF.23UBQNW6J1EZK@taiga> (view parent)
DKIM signature
missing
Download raw message
On Fri May 13, 2022 at 2:30 PM CEST, Drew DeVault wrote:
> On Fri May 13, 2022 at 2:27 PM CEST, John Gabriele wrote:
> > BTW, do users file bug reports in sourcehut? I just went to
> > <https://git.sr.ht/~sircmpwn/harec> to see if there is a bug report
> > on this, and I see tabs for "summary", "tree", "log", and "refs", ... but
> > where's the one for todo (or bug reports, issues, whatev)?
>
> SourceHut's bug trackers are not associated directly with git
> repositories. You can find the project hub here:

This has always confused me in Sourcehut. I have to go up all the way to `todo`, then back down to find the issue tracker in question. Maybe issue trackers could be linked to repos? Or at least a link to the tracker provided at the top of the repo description?
Details
Message ID
<52B770D9-C402-4B00-9A6B-E18E211B6D17@vladh.net>
In-Reply-To
<CJYOQUYHRKXY.XD6Q92GH8NZ3@dog> (view parent)
DKIM signature
pass
Download raw message
I also find this confusing.
Reply to thread Export thread (mbox)