@schlink not sure what you mean by "then run that string as a method call on a struct within the function"

@CobaltVelvet eek sorry. This is overly simplified, but:

Instead of

fn get_points(player: Player) -> u32 {
player.points
}
fn get_assists(player:Player) -> u32 {
player.assists
}
I want

fn get_stat(player: Player, stat: str) -> u32 {
player.send(stat)
}

get_stat(Sam, "assists");

Follow

@schlink @CobaltVelvet I don't know rust or ruby but that looks like something that a compiled, systems programming language doesn't have or need.

Β· Β· Tusky Β· 0 Β· 0 Β· 0
Sign in to participate in the conversation
LGBT.io

We are a Mastodon instance for LGBT+ and allies!