These are chat archives for rust-lang/rust

27th
May 2018
Tembo
@Tembocs
May 27 2018 06:45
Hi, where can I find documentation for Rust macros in the Second Edition of the book? Can't seem to see a chapter with such a section!
Andrey Lesnikov
@ozkriff
May 27 2018 06:54
https://doc.rust-lang.org/book/second-edition/appendix-04-macros.html - hm, all i see is a short appendix chapter
I think that they are waiting for macro 2.0 - rust-lang/rust#39412
but you can read the macro chapter from the first edition - it's still relevant
Tembo
@Tembocs
May 27 2018 06:59
@ozkriff thanks.
Andrey Lesnikov
@ozkriff
May 27 2018 07:00
@Tembocs also, there's The Little Book of Rust Macros with some hardcore stuff
Tembo
@Tembocs
May 27 2018 07:01
@ozkriff I never saw this before, thanks.
Andrey Lesnikov
@ozkriff
May 27 2018 07:02
btw, do you know about https://github.com/ctjhoa/rust-learning ? it has like a zillion of useful links
Tembo
@Tembocs
May 27 2018 07:03
@ozkriff, I once saw this, though didn't go back again.
Michael Thomas
@Michaelt293
May 27 2018 08:04
Hello, are BigInt and BigUint arbitrary precision?
Guillaume P.
@TeXitoi
May 27 2018 08:07
@Michaelt293 from the num crate? yes, but they are quite slow compared to a gmp binding.
Michael Thomas
@Michaelt293
May 27 2018 08:08
Yes, from the num crate, thanks.
brotzeit
@brotzeit
May 27 2018 11:51
is it possible to use a function as a closure so I can change variables of the calling function ?
Andrey Lesnikov
@ozkriff
May 27 2018 11:53
no, only closures can capture the environment
brotzeit
@brotzeit
May 27 2018 11:59
any reason ? it would be nicer to move a bigger closure outside of a function body
Sylwester Rąpała
@xoac
May 27 2018 12:26
Hi, I would need some cross-compilation help. I can't manage with libudev-sys for armv7. Full problem is described berkowski/tokio-serial#13.
As far as I understand I need libudev statically compiled for armv7-musl target. And then set path for that library to PKG-CONFIG. But I am not sure how to get libudev :(
Andrey Lesnikov
@ozkriff
May 27 2018 12:29
@brotzeit Hmm, because if you want to capture something you just write a closure. Or pass one into a function. I'm not sure what exactly do you want, can you show it on http://play.rust-lang.org ?
brotzeit
@brotzeit
May 27 2018 12:50
@ozkriff I got a big function where I want to use a big closure...and I think it's easier to read if I could put the closure outside of the function...I also don't want to use a function instead of the closure as it would have many arguments and it's not necessary in this situation
Andrey Lesnikov
@ozkriff
May 27 2018 12:54
are there any language that allows this?
Sylwester Rąpała
@xoac
May 27 2018 13:03
I found https://packages.ubuntu.com/artful/armhf/libudev-dev/filelist but there is only a dynamic libudev but I need link it statically..
brotzeit
@brotzeit
May 27 2018 13:39
@ozkriff I'm porting a C function + macro...that's why I got the idea