• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Extending library structs

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
JASS:
//! zinc
library t
{
    struct a
    {
    }
}
library b requires t
{
    struct c extends a
    {
    }
}
//! endzinc

How do i get this to compile? it gives me

Error : Could not find struct/interface "a"
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
try
JASS:
//! zinc
library t
{
    public struct a
    {
    }
}
library b requires t
{
    struct c extends a
    {
    }
}
//! endzinc
The "requires" keyword only sets the order in which the initializers are executed, it doesnt provide visibility.

But do you really wanna learn ZinC? I used it for a while and then came to the conclusion that compared to vJass it lacks compatibility and some features which doesnt legitimate the slightly less verbose syntax... but thats ur choice, just saying
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
try
JASS:
//! zinc
library t
{
    public struct a
    {
    }
}
library b requires t
{
    struct c extends a
    {
    }
}
//! endzinc
The "requires" keyword only sets the order in which the initializers are executed, it doesnt provide visibility.

But do you really wanna learn ZinC? I used it for a while and then came to the conclusion that compared to vJass it lacks compatibility and some features which doesnt legitimate the slightly less verbose syntax... but thats ur choice, just saying

Working fine for me, seems to have all the features that vJass has + it has a syntax closer to Java which is my secondary language so im not constantly swapping between "call" and semicolons :eek:

as far as i can tell, that worked. ty
 
Level 14
Joined
Jun 27, 2008
Messages
1,325
Working fine for me, seems to have all the features that vJass has + it has a syntax closer to Java which is my secondary language so im not constantly swapping between "call" and semicolons :eek:

yea i know the "calls" are annoying, but vJass is the standard (so most libraries and stuff are in vJass) and either a language is compatible to vJass or imo it needs some real advantages over jass that legitimate the lack of compability.

Problems with ZinC:
- vJass libs that are based on textmacros wont work in ZinC, you have to write warppers for everything
- ZinC has no stub classes/structs

If you want to learn a new language it strongly recommend WurstScript, its quite uncommon because it is not officially released yet, but its making great progress and is already extremely comfortable to use. The syntax is similar to Java (much less verbose than vJass) and the functionality covers most aspects of vJass but adds lots of higher level features that make coding in WurstScript so fast and efficient.
http://peq.github.com/WurstScript/manual.html
Read the manual if you are interested, i dont wanna push you into using it but as there are so many unfounded rumors about WurstScript on hive i want you to form your own opinion.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
yea i know the "calls" are annoying, but vJass is the standard (so most libraries and stuff are in vJass) and either a language is compatible to vJass or imo it needs some real advantages over jass that legitimate the lack of compability.

Problems with ZinC:
- vJass libs that are based on textmacros wont work in ZinC, you have to write warppers for everything
- ZinC has no stub classes/structs

If you want to learn a new language it strongly recommend WurstScript, its quite uncommon because it is not officially released yet, but its making great progress and is already extremely comfortable to use. The syntax is similar to Java (much less verbose than vJass) and the functionality covers most aspects of vJass but adds lots of higher level features that make coding in WurstScript so fast and efficient.
http://peq.github.com/WurstScript/manual.html
Read the manual if you are interested, i dont wanna push you into using it but as there are so many unfounded rumors about WurstScript on hive i want you to form your own opinion.
its not learning a new language its just syntax. also, no idea what your talking about with the textmacro stuff, ive written ~2k lines of zinc in a map with ~20k lines of vjass and im not encountering any issues
 
Status
Not open for further replies.
Top