www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - See docs compiler message

reply ixid <nuaccount gmail.com> writes:
/opt/compilers/dmd2/include/std/algorithm/iteration.d(663): 
Deprecation: function `std.range.Transposed!(string[], 
cast(TransverseOptions)0).Transposed.save` is deprecated - This 
function is incorrect and will be removed November 2018. See the 
docs for more details.

If it's going to say 'See the docs' how about linking the docs or 
even just specifying which docs it's referring to?
Mar 06 2018
next sibling parent Uknown <sireeshkodali1 gmail.com> writes:
On Tuesday, 6 March 2018 at 14:28:52 UTC, ixid wrote:
 /opt/compilers/dmd2/include/std/algorithm/iteration.d(663): 
 Deprecation: function `std.range.Transposed!(string[], 
 cast(TransverseOptions)0).Transposed.save` is deprecated - This 
 function is incorrect and will be removed November 2018. See 
 the docs for more details.

 If it's going to say 'See the docs' how about linking the docs 
 or even just specifying which docs it's referring to?
I agree that compiler error messages should be improved. If you are still wondering though, https://dlang.org/phobos/std_range.html#transposed is the relevant documentation
Mar 06 2018
prev sibling parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 3/6/18 9:28 AM, ixid wrote:
 /opt/compilers/dmd2/include/std/algorithm/iteration.d(663): Deprecation: 
 function `std.range.Transposed!(string[], 
 cast(TransverseOptions)0).Transposed.save` is deprecated - This function 
 is incorrect and will be removed November 2018. See the docs for more 
 details.
 
 If it's going to say 'See the docs' how about linking the docs or even 
 just specifying which docs it's referring to?
It's referring to the docs for std.range.Transposed.save (the deprecated symbol) I thought that was clear. Now, there aren't actually docs for Transposed, but you can find it if you look at std.range.transposed: https://dlang.org/phobos/std_range.html#transposed -Steve
Mar 06 2018
parent reply ixid <nuaccount gmail.com> writes:
On Tuesday, 6 March 2018 at 14:37:27 UTC, Steven Schveighoffer 
wrote:
 Now, there aren't actually docs for Transposed, but you can 
 find it if you look at std.range.transposed:

 https://dlang.org/phobos/std_range.html#transposed

 -Steve
Thanks, I had found that but that is not an explanation unless you have a lot of prior technical understanding of what save is and why it's not working. I guess it's a general doc quality issue - unless you're already very knowledgeable it's pretty much useless to understand the problem you have. I transposed a range of ranges to pass to a function to get the distance between characters in strings. That works fine, as does printing the result. But it then complains if I try to do anything like fold with the result.
Mar 06 2018
next sibling parent ixid <nuaccount gmail.com> writes:
On Tuesday, 6 March 2018 at 14:50:05 UTC, ixid wrote:
 On Tuesday, 6 March 2018 at 14:37:27 UTC, Steven Schveighoffer 
 wrote:
 Now, there aren't actually docs for Transposed, but you can 
 find it if you look at std.range.transposed:

 https://dlang.org/phobos/std_range.html#transposed

 -Steve
Thanks, I had found that but that is not an explanation unless you have a lot of prior technical understanding of what save is and why it's not working. I guess it's a general doc quality issue - unless you're already very knowledgeable it's pretty much useless to understand the problem you have. I transposed a range of ranges to pass to a function to get the distance between characters in strings. That works fine, as does printing the result. But it then complains if I try to do anything like fold with the result.
What is the correct way to iterate a range of ranges as transposed does?
Mar 06 2018
prev sibling parent Steven Schveighoffer <schveiguy yahoo.com> writes:
On 3/6/18 9:50 AM, ixid wrote:
 On Tuesday, 6 March 2018 at 14:37:27 UTC, Steven Schveighoffer wrote:
 Now, there aren't actually docs for Transposed, but you can find it if 
 you look at std.range.transposed:

 https://dlang.org/phobos/std_range.html#transposed
Thanks, I had found that but that is not an explanation unless you have a lot of prior technical understanding of what save is and why it's not working. I guess it's a general doc quality issue - unless you're already very knowledgeable it's pretty much useless to understand the problem you have.
There are 2 problems. One is that Transposed offered .save as a member, when it shouldn't have (it's not a valid forward range). This is clear from trying to even use it as a forward range. Even when you call save, it destroys the original. The other problem is that I think algorithms are seeing that .save is there, and thinking it's a forward range, so using it that way.
 I transposed a range of ranges to pass to a function to get the distance 
 between characters in strings. That works fine, as does printing the 
 result. But it then complains if I try to do anything like fold with the 
 result.
I have no idea how save is called, but apparently it is somewhere in there. -Steve
Mar 06 2018