Jellycuts-Issues icon indicating copy to clipboard operation
Jellycuts-Issues copied to clipboard

Import Jelly files into other Jelly files

Open ActuallyTaylor opened this issue 3 years ago • 2 comments
trafficstars

Transcribed from WaterMelom🍉#7377 on discord

Create the ability to import one Jelly file into another Jelly file. This would allow you to have JellyFile1 and JellyFile2 and then import JellyFile1 into JellyFile2.

JellyFile1:

func myFunction() {

}

JellyFile2:

#import JellyFile1.jelly

myFunction()

ActuallyTaylor avatar May 23 '22 16:05 ActuallyTaylor

This could be implemented as part of the repository system and I suggest should be merged together under a group issue called Jellycuts import, I will write a complete import syntax suggestion below.

MinecraftPublisher avatar May 23 '22 17:05 MinecraftPublisher

These are the ones that I recommend:

import JellyFile1.jelly
JellyFile1.myFunction()
import myFunction from JellyFile1.jelly
myFunction()

And these ones are suggested but not recommended.

import JellyFile1.jelly as Functions1
Functions1.myFunction()
import myFunction as func from JellyFile1.jelly
func()

MinecraftPublisher avatar May 23 '22 17:05 MinecraftPublisher