fn contains(range: &AddrRange, addr: &IpAddr) -> bool {
range.min <= addr && addr <= range.max
Looks ugly as fudge.Syntax is not everything, but it also shows that people too easily think they are great at language design when they really aren't. It's fascinating to watch how people continue with such an approach. How many people are going to use that over, say, python?
def contains(range_: AddrRange, addr: IpAddr) -> bool:
return range_.min <= addr <= range_.max
I don't get it, how is that much better?glad you like python, but a good reason to use this is setup being easier, also for people using rust, chances are the syntax is better compared to python. (also for what its worth, i picked up rust MUCH faster than i ever did with python)
the main reason i like rust is its explicitness in typing along with its syntax choices. memory safety means little imo, outside of being difficult to do strange stuff (which could be good or bad depending on your approach)
cargo add roto
code main.rs
-FILE- main.rs use roto::*;
fn main(){ roto::init_runtime() roto::load_script("hello.roto") }
-FILE-END-
code hello.roto
-FILE- hello.roto fn main() { print("Hello, world!"); } -FILE-END-
cargo run