Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #16939
| From | Stefan Monnier <monnier@iro.umontreal.ca> |
|---|---|
| Newsgroups | comp.arch, comp.programming |
| Subject | Re: Rust |
| Date | 2026-10-11 14:26 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <jwvcxtg9jxl.fsf-monnier+comp.arch@gnu.org> (permalink) |
| References | (1 earlier) <2026Oct6.102919@mips.complang.tuwien.ac.at> <11a6326$qkk$1@reader2.panix.com> <2026Oct10.161800@mips.complang.tuwien.ac.at> <11adson$sir$1@reader2.panix.com> <2026Oct11.174012@mips.complang.tuwien.ac.at> |
Cross-posted to 2 groups.
> Which leads to the question? Can an experienced Rust programmer do a > search that works like the C search(), and an insert that calls > search() and then uses the reference to either update a node or insert > a new one? IIUC it can but at the cost of making `search` take a `&mut` reference. I get the impression that you'd otherwise need "mutability polymorphism", i.e. a single piece of code that can be instantiated either for `&` or for `&mut`. You can probably avoid writing the code twice, tho, by abusing macros (aka "template polymorphism"). === Stefan
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Rust (was: Optimization by programmers) cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-07 18:29 +0000
Re: Rust (was: Optimization by programmers) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-10-10 14:18 +0000
Re: Rust (was: Optimization by programmers) cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-10 17:31 +0000
Re: Rust (was: Optimization by programmers) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2026-10-11 15:40 +0000
Re: Rust Stefan Monnier <monnier@iro.umontreal.ca> - 2026-10-11 14:26 -0400
Re: Rust cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-12 19:14 +0000
Re: Rust Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-10-12 21:15 +0000
Re: Rust (was: Optimization by programmers) cross@spitfire.i.gajendra.net (Dan Cross) - 2026-10-12 19:13 +0000
csiph-web