Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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!

3 comments

0

These can only be edited by core-scripts. These cannot be edited.

(As far as I know)

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 :/

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".

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.