[Issue 14125] @trusted nested helper functions in std.file

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 Iain Buclaw changed: What|Removed |Added Priority|P1 |P4 --

[Issue 14125] @trusted nested helper functions in std.file

2018-03-03 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #80 from Walter Bright --- (In reply to Walter Bright from comment #79) > This pull request: > > https://github.com/dlang/phobos/pull/4786 has been pulled. --

[Issue 14125] @trusted nested helper functions in std.file

2016-09-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #79 from Walter Bright --- This pull request: https://github.com/dlang/phobos/pull/4786 will help simplify things in std.file by making some of the machinations to work with both arrays and ranges unnecessary.

[Issue 14125] @trusted nested helper functions in std.file

2015-02-13 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 Denis Shelomovskij verylonglogin@gmail.com changed: What|Removed |Added CC|

[Issue 14125] @trusted nested helper functions in std.file

2015-02-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #77 from Andrei Alexandrescu and...@erdani.com --- Thanks Steve for the nice summary! --

[Issue 14125] @trusted nested helper functions in std.file

2015-02-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 John Colvin john.loughran.col...@gmail.com changed: What|Removed |Added CC|

[Issue 14125] @trusted nested helper functions in std.file

2015-02-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #74 from Walter Bright bugzi...@digitalmars.com --- (In reply to hsteoh from comment #68) Then there's Andrei's PR that contains a 50+-line @trusted function. I had a headache trying to figure out whether it was truly @trusted -- it's

[Issue 14125] @trusted nested helper functions in std.file

2015-02-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #76 from Steven Schveighoffer schvei...@yahoo.com --- After reading this quite long thread (and I'm not going to CC myself because of this), I want to summarize the viewpoints here. I think I see that everyone is in slight agreement, but

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #50 from Zach the Mystic reachz...@gmail.com --- (In reply to Zach the Mystic from comment #48) I think it would be funny if a @trusted function with fewer than two statements was automatically rejected by the compiler. Since an

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #64 from Andrei Alexandrescu and...@erdani.com --- First step: https://github.com/D-Programming-Language/phobos/pull/2963 --

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #65 from Dicebot pub...@dicebot.lv --- (In reply to Andrei Alexandrescu from comment #62) I don't see how this is pushing your argument further. Make a technical point and it'll be well appreciated. Big chunks of @trusted are

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #66 from Dicebot pub...@dicebot.lv --- Thanks, Walter! This comment alone was more useful and meaningful than rest of this thread combined :) Let me use example from the very same std.file to oppose: S readText(S = string)(in char[]

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #67 from Andrei Alexandrescu and...@erdani.com --- (In reply to Dicebot from comment #65) (In reply to Andrei Alexandrescu from comment #62) I don't see how this is pushing your argument further. Make a technical point and it'll be

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 David Nadlinger c...@klickverbot.at changed: What|Removed |Added Summary|std.file has gotten out of |@trusted nested helper

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #39 from Walter Bright bugzi...@digitalmars.com --- (In reply to David Nadlinger from comment #36) May I suggest that you try to understand the issue at hand instead of repeating the same non-solution over and over again? For a small

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #40 from David Nadlinger c...@klickverbot.at --- (In reply to Walter Bright from comment #39) (In reply to David Nadlinger from comment #36) May I suggest that you try to understand the issue at hand instead of repeating the same

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #41 from Andrei Alexandrescu and...@erdani.com --- (In reply to hsteoh from comment #35) @Andrei: any @safe function can call a @trusted function that may contain arbitrary unsafe operations. Just because something is marked @safe at

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #42 from Andrei Alexandrescu and...@erdani.com --- (In reply to David Nadlinger from comment #40) (In reply to Walter Bright from comment #39) (In reply to David Nadlinger from comment #36) May I suggest that you try to understand

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #44 from Walter Bright bugzi...@digitalmars.com --- (In reply to David Nadlinger from comment #40) grep for trusted[A-Z]. For example, trustedCast() in join(). For reference: static U trustedCast(U, V)(V v) @trusted { return cast(U)

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #45 from Andrei Alexandrescu and...@erdani.com --- (In reply to Walter Bright from comment #44) I understand you want the ...safe code... to be checked for safety. Here's how to do it: @trusted join() { @safe {

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #43 from Andrei Alexandrescu and...@erdani.com --- (In reply to David Nadlinger from comment #38) What is your point? @trusted can be used incorrectly. Nothing new and exciting so far. His point is that gainful use of @trusted is for

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #47 from Walter Bright bugzi...@digitalmars.com --- (In reply to Andrei Alexandrescu from comment #45) That's beautiful. Too bad it doesn't work :o). I did say I paraphrased it. I've come out against supporting @trusted { ... code

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #37 from Walter Bright bugzi...@digitalmars.com --- (In reply to hsteoh from comment #35) @Andrei: any @safe function can call a @trusted function that may contain arbitrary unsafe operations. Just because something is marked @safe at

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #38 from David Nadlinger c...@klickverbot.at --- (In reply to Walter Bright from comment #34) This also flunks that rule: @safe T* func(T* p) { @trusted { p += 5; } return p; } So does this:

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #46 from Walter Bright bugzi...@digitalmars.com --- I was a bit curious where these misunderstandings came from. Turns out, example code for C# 'unsafe' code presents not only unsafe code, but an unsafe interface:

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #71 from David Nadlinger c...@klickverbot.at --- (In reply to Andrei Alexandrescu from comment #61) Well I just did - std.file does count for real-world code. It's just not right. Hold on a second. I'm suggesting that trying to clean

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #68 from hst...@quickfur.ath.cx --- (In reply to Dicebot from comment #66) [...] Wrapper is marked @trusted incorrectly but that is intentional. @trusted here is not used to tell function can actually be trusted but to keep everything

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #69 from Dicebot pub...@dicebot.lv --- Sure, I don't hold any bad feeling about it - won't be the first time something very uncomfortable for me happens in language upstream :) Only thing I wanted to clarify is that existing code is not

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #70 from Andrei Alexandrescu and...@erdani.com --- Loosely related: https://github.com/D-Programming-Language/druntime/pull/1157. That and more like it is definitely good to do. --

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #72 from Andrei Alexandrescu and...@erdani.com --- (In reply to hsteoh from comment #68) Then there's Andrei's PR that contains a 50+-line @trusted function. I had a headache trying to figure out whether it was truly @trusted -- it's

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #73 from Andrei Alexandrescu and...@erdani.com --- (In reply to David Nadlinger from comment #71) (In reply to Andrei Alexandrescu from comment #61) Well I just did - std.file does count for real-world code. It's just not right.

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #62 from Andrei Alexandrescu and...@erdani.com --- (In reply to Dicebot from comment #60) (In reply to Andrei Alexandrescu from comment #58) (In reply to Dicebot from comment #57) You shouldn't consider those wrapper really @trusted

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #63 from Walter Bright bugzi...@digitalmars.com --- (In reply to David Nadlinger from comment #49) No. I want the ...safe code..., which is in fact ...code that might be safe depending on the template arguments..., to trigger attribute

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 Zach the Mystic reachz...@gmail.com changed: What|Removed |Added CC||reachz...@gmail.com

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #49 from David Nadlinger c...@klickverbot.at --- (In reply to Walter Bright from comment #44) I understand you want the ...safe code... to be checked for safety. No. I want the ...safe code..., which is in fact ...code that might be

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #53 from Andrei Alexandrescu and...@erdani.com --- (In reply to David Nadlinger from comment #51) (In reply to Andrei Alexandrescu from comment #42) Sigh, std.array has become another disaster area we need to clean. What about just

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #57 from Dicebot pub...@dicebot.lv --- You shouldn't consider those wrapper really @trusted - they have _never_ supposed to be ones. It is simply a workaround for bunch of language limitations. I'd love to have something better to address

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #58 from Andrei Alexandrescu and...@erdani.com --- (In reply to Dicebot from comment #57) You shouldn't consider those wrapper really @trusted - they have _never_ supposed to be ones. It is simply a workaround for bunch of language

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #61 from Andrei Alexandrescu and...@erdani.com --- (In reply to David Nadlinger from comment #59) (In reply to Andrei Alexandrescu from comment #53) (In reply to David Nadlinger from comment #51) (In reply to Andrei Alexandrescu

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #51 from David Nadlinger c...@klickverbot.at --- (In reply to Andrei Alexandrescu from comment #42) Sigh, std.array has become another disaster area we need to clean. What about just giving it a try? You might even discover that there

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #52 from Dicebot pub...@dicebot.lv --- (In reply to David Nadlinger from comment #51) (In reply to Andrei Alexandrescu from comment #42) Sigh, std.array has become another disaster area we need to clean. What about just giving it a

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #54 from Andrei Alexandrescu and...@erdani.com --- (In reply to Dicebot from comment #52) (In reply to David Nadlinger from comment #51) (In reply to Andrei Alexandrescu from comment #42) Sigh, std.array has become another disaster

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #55 from Dicebot pub...@dicebot.lv --- I don't see any counterarguments, only trying to explain what @trusted is suppposed to mean (which I am perfectly aware of). It does not address break @trusted by adding code concern which is a

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #56 from Andrei Alexandrescu and...@erdani.com --- (In reply to Dicebot from comment #55) I don't see any counterarguments, only trying to explain what @trusted is suppposed to mean (which I am perfectly aware of). It does not address

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #60 from Dicebot pub...@dicebot.lv --- (In reply to Andrei Alexandrescu from comment #58) (In reply to Dicebot from comment #57) You shouldn't consider those wrapper really @trusted - they have _never_ supposed to be ones. It is

[Issue 14125] @trusted nested helper functions in std.file

2015-02-04 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14125 --- Comment #59 from David Nadlinger c...@klickverbot.at --- (In reply to Andrei Alexandrescu from comment #53) (In reply to David Nadlinger from comment #51) (In reply to Andrei Alexandrescu from comment #42) Sigh, std.array has become another