Re-declare a function with a different name #24182
Unanswered
gchumillas
asked this question in
Questions and Answers
Replies: 2 comments
-
OK, I asked Claude AI and we found this: |
Beta Was this translation helpful? Give feedback.
0 replies
-
What fn C.sgp_setup(desc &Desc) // the private
@[inline]
pub fn setup(desc &Desc) { // the public
C.sgp_setup(desc)
} Well, you have to do a recall I don't know if there exists an "alias" for functions: fn private() string {
return 'private'
}
pub fn public() string {
return private()
}
fn main() {
println('${public()}') // prints private
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm creating a module, and I would like to re-export a function with another name. For example:
So an internal developer would write
car := new_car()
, which is more "idiomatic". But an external developer would writecar := ferrary.car()
, which is more concise.Is there a V way to do this?
Beta Was this translation helpful? Give feedback.
All reactions