Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
5

[Q] Any actual way to "rename" Function?

Asked by 5 years ago

I'm basically creating a programming language inside a programming language, like a "simpler" Lua, and I'm wondering if I can make it so you can use:

fnc somefunction()

instead of:

function somefunction()

I think I've seen people do this aka just defining the "fnc" somehow, any help would be appreciated!

0
These can only be edited by core-scripts. These cannot be edited. (As far as I know) Oficcer_F 207 — 5y
0
i think you're thinking of something similar to #define in c++. i dont think theres any macro (i'm not sure if i'm using the right term but whatever) functionality in roblox lua :/ radusavin366 617 — 5y
0
You'd need to write a compiler for your language, there is no need to do this and there's no reason to do "fnc". Avigant 2374 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Unfortunately within roblox this isn't possible. Roblox allows you to define your own functions, and variables. Doing something like fnc myFunction() isn't practical. The myFunction() is possible, but something like fnc isn't. Something like local fnc = myFunction() would work, but I'm aware that it isn't exactly what you're looking for.

However, if you decide to switch to lua (off roblox), then this is possible. I've seen people go crazy and make their own programming language, within a programming language they've made.

Ad

Answer this question