« first day (2004 days earlier)      last day (1467 days later) » 

8:49 AM
 
 
1 hour later…
9:54 AM
ding
 
 
1 hour later…
11:21 AM
@E_net4iscleaningup you level up in WoW?
 
@PeterVaro fartwizard69
wonderfull now I need to change my password !
 
LOL
 
@Shepmaster No wai
 
Anyway, the above comic made me giggle and chuckle -- I mean, this is a classic joke for our generation
I remember I went through the exact same process with my parents..
..albeit my password wasn't fartwizard69, but close enough
 
^ Resolving Ok-wrapping for try blocks
 
11:42 AM
@Shepmaster I'm in the neutral group on this particular problem -- let's see how it goes.. I'm really keen on using the try-blocks myself, after all, it is such a cool feature.. that being said I have doubts that anything that introduces more nesting would be responsible for (less competent) developers writing unnecessarily nested code, which is something I don't like to see (and read)..
 
12:02 PM
-1
Q: How do I call a getter from another Substrate module?

Phil HI have two modules, MyCore and Special. MyCore has a public getter: pub fn get_core_account() -> Option<T::AccountId> Which gets an accountId. If I call this from Special in a simple manner: let core_account = MyCore::get_core_account(); then rustc complains that it can't infer the type, wh...

 
@Shepmaster I like this
 
@Stargateur in which way?
 
that include more that io error is good :p
 
Oh shoot. I meant to link to all the comments, not just the one I replied to.
“Instead of using impl blocks I just made everything a function”
 
 
2 hours later…
2:18 PM
Is it acceptable to use Result<(),()> as return type of an operation which often can't be done ?
 
@DenysSéguret That's called an owl result. Some people might find that more useful than a bool. There are a few similar examples in std of results in which the error type isn't an error, if you'd like to have a look. (e.g. binary_search_by).
 
ok, so I'll take it it is acceptable, thanks
It's not really more useful than a bool for me, it's just clearer. I don't really like bools in arguments and returned types except when the function is something like has_ or is_
 
That's fair!
 
2:42 PM
@DenysSéguret but why not a real error type?
 
@Shepmaster Imagine a stack with an operation which consumes elements (without returning anything) until there's nothing less. There's no error, it's just empty. An alternative I'm considering is Option<()>
But in fact I prefer to force the user (me) to check the error so I'll keep the owl
(further operations are forbidden)
 
3:14 PM
> there’s no error
> check the error
I mean, create something like
struct NothingLeft(());
 
3:31 PM
@Shepmaster What's with the (())?
 
3:42 PM
unit-tuple type whose single field is a unit
...not quite sure why that'd be preferable to an empty type?
 
struct NothingLeft(((((((((((())))))))))));
 
@Zarenor has to do with constructability
struct NothingLeft; can be constructed by anyone.
 
4:10 PM
Why stop anyone from creating a NothingLeft when there's nothing left to do?
 
4:28 PM
Mostly to be conservative to start.
It’s compatible to allow it to be made, but the other way it’s a semver breakage.
 
Hum... why is vec.swap_remove not returning an option ? Are all normal paths involving a previous check ?
 
4:51 PM
> attempts to transfer ownership
> sends a reference
 
 
6 hours later…
10:40 PM
@DenysSéguret totally
 

« first day (2004 days earlier)      last day (1467 days later) »