• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Status
Not open for further replies.
Top