Jump to content

Photo

Global Variables vs. Global(Variables) & Functions - Maximums?

variables limits maximums caps global variable limit maximum cap local

  • Please log in to reply
46 replies to this topic

#16 anikom15

anikom15

    Dictator

  • Banned
  • Real Name:Westley
  • Location:California, United States

Posted 02 June 2014 - 04:49 PM

Zoria, remember that we are people offering our time to read and respond to your questions. We are not obligated to answer them, nor are you entitled to know any of this information. Thus, I recommend you reserve your questions for the most dire of situations. Case-in-point: you often ask if code examples work without testing them first.

Surely an engineer would have the gravitas to self-educate and experiment.

#17 RetraRoyale

RetraRoyale

    Doyen(ne)

  • Members

Posted 02 June 2014 - 06:19 PM

I don't really think Zoria is being overly demanding, here.

 

But I do think the demands are like those a frustrated architect who wants to build a skyscraper from toothpicks; asking that the toothpick manufacturer provide detailed specifications of the tolerances and strengths of toothpicks for building construction.


Edited by RetraRoyale, 02 June 2014 - 06:24 PM.


#18 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 02 June 2014 - 08:21 PM

I don't have time to get involved in any Q&A right now, but just have to throw the possibility of adding a quest rule that disables saving of any global variables in the save file out there, since most of the time you don't want the majority of the global vars/arrays saved anyway.

I am usually against more rules, but this seems like it should have implemented from the get-go. hmm...

#19 anikom15

anikom15

    Dictator

  • Banned
  • Real Name:Westley
  • Location:California, United States

Posted 02 June 2014 - 08:58 PM

You ... don't?

#20 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 02 June 2014 - 11:20 PM

You ... don't?


That's right mister smarty-pants. I don't. D:
  • Mero likes this

#21 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 03 June 2014 - 07:06 AM

I don't have time to get involved in any Q&A right now, but just have to throw the possibility of adding a quest rule that disables saving of any global variables in the save file out there, since most of the time you don't want the majority of the global vars/arrays saved anyway.

I am usually against more rules, but this seems like it should have implemented from the get-go. hmm...

 

The place where I see that as most useful, is for platform games, that use a lives system, with onContinue scripts that set initial vars; SCHMUP-style games; and other points-based, or arcade-style games.

 

Zoria, remember that we are people offering our time to read and respond to your questions. We are not obligated to answer them, nor are you entitled to know any of this information. Thus, I recommend you reserve your questions for the most dire of situations. Case-in-point: you often ask if code examples work without testing them first.

Surely an engineer would have the gravitas to self-educate and experiment.

 
If you were building an induction coil, would you try to re-create Faraday's original experiments to figure out the mathematics, or would you look up Faraday's Law, and use what is known so that you don;t waste years of your time re-inventing the wheel?
 
If you needed a reference on those equations, would someone telling you it's 'something like':
 
ΔB
-----  = etc.
Δt
 
...be sufficient, or would you want to know the actual equations, and the meanings of each constant, each variable, and the logic of the mathematics, so that you can fully comprehend what's happening, to make use of it?
 
Similarly, would you try every single metallic element, gauge of wire, and material, or use reference material to be certain of the correct balancing factors, in the equations, to produce the result that you need?
 
You study mathematics: Are you expected to understand every equation that you see, without some kind of technical reference, and preliminary explanation? You have read white papers before, right?
 
Dear me, look at one data sheet sometime, and you'll find out just how much information we consider
'the bare minimum'.
 
I also ask this: If you run into a problem, where you need someone to verify your methods, what would you do? Are you not humble enough to ask for assistance, feedback, and input from people working in the same field?
 
The Bottom Line
Knowing how something works, is equally important to knowing why something works. Engineering is a science, which means it relies on facts: the more facts you have, the more accurately you can predict the outcome of any process. I believe in having useful, factual knowledge; and as I've already stated, the materials here are useful to me, so that I know what limitation factors I have to work with, and what I will not be able to do, because of those limiting factors.
 
We don't do things that aren't necessary steps in a procedure, and we don't work with minimal information as a standard. Minimal information puzzles are fantastic mental tests, but they don;t improve productivity. I'd rather have 'too much' information, including what I may not need, than not enough, including what I do need.
 
Being told what I do, or do not need, from people that don't know what I'm doing, and why the information is applicable, is plain arrogant, IMO.
 
For the record, I did stipulate 'time allowing', with my request: That's not a demand.
 
 
 
 

I don't really think Zoria is being overly demanding, here.
 
But I do think the demands are like those a frustrated architect who wants to build a skyscraper from toothpicks; asking that the toothpick manufacturer provide detailed specifications of the tolerances and strengths of toothpicks for building construction.

 
 
art_bigben.jpg
http://www.toothpickworld.com/

 

Toothpick-3-204x300.jpg

http://www.ripleysne...ick-stagecoach/

 

 
The ideology of: 'Because, I can...'


Edited by ZoriaRPG, 03 June 2014 - 07:20 AM.


#22 RetraRoyale

RetraRoyale

    Doyen(ne)

  • Members

Posted 03 June 2014 - 09:56 AM

What makes you think we don't know what you're doing? I read almost everything you post on ZC, (and a lot of your work on your other RPG projects.) You put a lot of effort into what you do, and that's admirable.

 

But when you indicate that you don't know the fundamental difference between a function and a variable, that's a serious obstacle. Especially when you have such ambitious goals, because it means you are probably unaware of how advanced data structures work, and that you aren't aware of the easy ways to build solutions to your goals.

 

If you want a text database, you should use a text database, not a kludge of arrays. There is something fundamentally unsound about exhausting finite resources on a Turing complete machine, as you have an arbitrarily deep hierarchy of abstractions at your disposal. You could spend a long time working on a problem that someone else could solve in minutes with a better model.


Edited by RetraRoyale, 03 June 2014 - 09:57 AM.


#23 anikom15

anikom15

    Dictator

  • Banned
  • Real Name:Westley
  • Location:California, United States

Posted 03 June 2014 - 10:46 AM

If you were building an induction coil, would you try to re-create Faraday's original experiments to figure out the mathematics, or would you look up Faraday's Law, and use what is known so that you don;t waste years of your time re-inventing the wheel?

If you needed a reference on those equations, would someone telling you it's 'something like':

ΔB
----- = etc.
Δt

...be sufficient, or would you want to know the actual equations, and the meanings of each constant, each variable, and the logic of the mathematics, so that you can fully comprehend what's happening, to make use of it?

Similarly, would you try every single metallic element, gauge of wire, and material, or use reference material to be certain of the correct balancing factors, in the equations, to produce the result that you need?

You study mathematics: Are you expected to understand every equation that you see, without some kind of technical reference, and preliminary explanation? You have read white papers before, right?

Dear me, look at one data sheet sometime, and you'll find out just how much information we consider
'the bare minimum'.

I also ask this: If you run into a problem, where you need someone to verify your methods, what would you do? Are you not humble enough to ask for assistance, feedback, and input from people working in the same field?

The Bottom Line
Knowing how something works, is equally important to knowing why something works. Engineering is a science, which means it relies on facts: the more facts you have, the more accurately you can predict the outcome of any process. I believe in having useful, factual knowledge; and as I've already stated, the materials here are useful to me, so that I know what limitation factors I have to work with, and what I will not be able to do, because of those limiting factors.

I don't disagree with this. This is the software world though, and it is generally expected that you test code samples before asking about them because it is almost always inconsequential to do so.

If you were to ask such questions on StackOverflow, I'd imagine you'd get 'Is this homework?'

If I ever do my ZC documentation project (something I want to do most likely after The Last Emperor), it will take a lot of trial and error. Even if behavior is known, it should still be verified. That's good science and many classic experiments (including Faraday's) are still done to this day with the latest instruments.

I also agree with RetraRoyale in this instance. You do seem to lack an understanding of the basics.

Edited by anikom15, 03 June 2014 - 10:50 AM.


#24 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 03 June 2014 - 06:08 PM

(Q) Exactly what constitutes a global variable?
Any variable defined at global (ie; no curly brace or function) scope. :P

(Q) How is the data size of an array element defined, and by what means is is constrained
Arrays are simply a dynamic array of 32-bit integers.

class ZCArray {  int32 *p;  u32 capacity, size;}
(Q) Is the maximum number of variables and functions running at one time, a single value, or are they segregated into their own memory pages?
Besides built-in objects and arrays, script memory is more or less stack-based.

(Q) What is the maximum number of functions in any single scope?
Same as below, unless you are talking about ffc local functions (which I think are just mangled global functions, but I'm not sure).

(Q) What is the maximum number of functions, that can be compiled?
I *think* these are limited only by available memory.

(Q) What differentiates a function, from a variable, to the compiler?
A set of rules and tokens accepted by the parser which are defined to represent language semantics. I don't really have a good answer for this. The parser is built upon flex/bison. Very old (and incomplete) implementation can be browsed here: http://code.google.c...se/trunk/parser , but it's not likely to help you at all.

(Q) Are values stored in the sav file limited to a specific field size, and if so, what is that size?
All user-defined script vars are 32-bit size. With possible compression this is 4-bytes at most per variable.


edit: Each script has their own stack as well, so memory of variables is not shared between scripts, this allows users to suspend execution of any script at almost any time and preserve the state of the script via a WAITFRAME code. The exception to this is item scripts which are shared--this is why they can only run for a single frame.

#25 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 05 June 2014 - 01:24 PM

Thank you Gleeok, for taking the time to answer these questions!

 

One thing on which I'm curious: When ZScript is compiled, is it compiled into the same format as ZASM, or is it different to that? There are many aspects of the compiler that aren't documented, and that;s one of them...

 

The ZASM instructions don't seem to have equivalents for many ZScript instructions/operations, although perhaps I'm just not thinking too deeply about that; so I'm guessing that the assembled binary is different, but I have no way of knowing, because there's no way to view the post-assembled code (to my knowledge). I don;t even know t this point if there is anything that you can do in ZASM, that you can't do in ZScript, primarily because no-one uses the assembly code options--the problem of working with ASM and script code at the same time is what I blame for this; particularly with the potential of address conflicts..

 

(I'm also curious if there's a de-compiler, but that;s even more trivial; and I suspect that no such thing exists.)

 

One thing that I thought woud be a nice featurek is to have an option to save all code imported via 'import' commands as ZScript code somehow, from within the quest file, via an 'export' command, to prevent losing code in the future; and an option to view/re-assign slots without re-compiling would be very brill; as would an option to append code 

 

This last idea is useful if you resume working on an old project, and no longer have the original script files. Because imports aren't stored in the buffer people can lose a lot of work. (That's why i back up everything to multiple local, and multiple remote sources.

 

Being able to view slot assignments would just be a handy time-saver; but being able to change slot assignments, would be useful (again) if people lose scripts and need to modify a game thereafter. That combined with an append function, would be interesting, but I'm not certain what information is stored in the .qst file, and if the original scrip code is stored, or only the assembled code.

 

(I don't expect that exporting scripts would be possible, as I assume that the compiler stores everything in its post-compiled form, but really, I have no idea how this works internally.)

 

Note: These are ideas, or musings; not requests.

 

What makes you think we don't know what you're doing? I read almost everything you post on ZC, (and a lot of your work on your other RPG projects.) You put a lot of effort into what you do, and that's admirable.

 

But when you indicate that you don't know the fundamental difference between a function and a variable, that's a serious obstacle. Especially when you have such ambitious goals, because it means you are probably unaware of how advanced data structures work, and that you aren't aware of the easy ways to build solutions to your goals.

 

If you want a text database, you should use a text database, not a kludge of arrays. There is something fundamentally unsound about exhausting finite resources on a Turing complete machine, as you have an arbitrarily deep hierarchy of abstractions at your disposal. You could spend a long time working on a problem that someone else could solve in minutes with a better model.

 

By 'other RPG projects', do you mean my work in print, and my printed matter in development?

 

I'm not fundamentally versed in most (common) curly brace languages, but if you've noticed, once I have a direct answer, or a working example, I never need to ask the same question again, and I generally produce rather rapid results. The syntax in C is fundamentally different from what I'm used to seeing, and I have no practical need for it elsewhere.

 

I wouldn't expect most people here to be able to make heads, or tails, of what I'm accustomed to seeing either; but i wouldn't discount their ability, education, or capacity to learn, simply based on their lack of familiarity with one method.

 

It's far more straightforward to inquire to people who know the answer, than to make a guess, and trudge about in the dark. One of my main concerns, is always that regardless what C language documentation read, it isn't applicable in ZScript, because ZC has a limited compiler, that truncates / depreciates many otherwise-available statements, and types of operations, and may not use standard routines for initialisation, expression, and formatting. The ZC compiler is also extremely un-forgiving, while not often reporting a concise fault description. I can give you some examples if you wish, but it's probably not worth your time.

 

That said, while I do comprehend the operational difference between a function, and a variable, my question related to the ZC compiler, and how it makes the determination between the two. I didn't overly note this, but there is a bit of a conflict in two regards, with respect to my OP in this thread:

 

1. I was told ta long time back, at any global int,  float, or boolean, is limited to 256 maximum as a whole (i.e 256 total of all three types, in any combination.). That statement, did not include the crucial information: 'except when used as a function'. I'm sure that it may have been implied, but when dealing with this sort of thing, I take things at literal, face value. if I'm told that there is a 256 maximum limitation on ints, floats, and bools used in global scope, I assumed that it doesn't matter if they are functions, or if they are variables, or constants, with the exception of void types, which are static (although I assumed there was some limit on these as well, simply because there was a limit for everything else).

 

Most standard compilers does not have the same limitations, and the quirks of ZScript. My question was if the ZScript compiler differentiated them, or if the limit was on posed on both; and what the minimum requirement was to distinguish the two, and I wouldn't need to worry about it. If they do have limits, they are generally much higher, more uniform, and based on system architecture.

 

That's the information on which I was operating, and wasting a great deal of time in the process. I still believe that both parens, and curly braces can be used to denote a function; and some languages can accept one, the other, or both as identifiers. This is often compiler-specific. (Note: I'll need to examine Bison, but given how much the ZScript compiler diverges from others, who knows that is technically true.)

 

2. ZC has two, distinct terms that include the term 'global', that can lead to confusion. I didn't think that a variable defined in the scope of a global script was treated as a global variable with regard to compiler limitations; and I knew with absolute certainty that it wasn't handled as a global variable; but I needed some confirmation on the former.

 

This references back to problem 1, being told that 'all global ints, floats, and bools, are lumped together into one cap'. When you're looking at lists of dozens of declarations that you're afraid to use, because you don;t know the precise limits, it[s a stressful, and tiresome exercise in futility to hammer them into a massive codebase.

 

The same applies to asking for a list of technical limitations: If what I want to do isn't possible, due to one (or more) restrictions, I;d rather know about them in advance, and either plan around them, or work out an alternative method for using them. There is simply no reference material on this... I've never seen, stated anywhere (prior to this thread), if there is a limit on constants, and functions. I assumed there was, because there's an arbitrary limit on everything else.

 

That's precisely why I asked about those limits, including limits on simultaneous values.

 

When someone tells me that I 'don't need' that information, I find that absurd; as they can't possibly know what all of my plans are, and how I would like to implement things. Unless they've masted telepathy, and can remotely read my mind, they may have an idea of my ultimate goals, but certainly not my immediate needs. That'd be little different to me stating you 'don't need' some medication, that if you go without, will cause suffrage, simply because I'm not aware of your health problems. It's not the same as stating that I don't 'need' roast beef, to survive.

 

Stating that no-one needs to know these types of limits, is also mad. I can understand if the present developers don't themselves know them, and don't have time at presently to determine them, that it's nigh impossible to obtain the information; but that doesn't mean 'tisn't valuable information to document. I've literally wasted hundreds of hours of time trying to work around limits, that I now find, don't exist.

 

I also request clarification on terms such as 'unlimited', as people are apt to use that when the limit is so high, that they believe no-one will ever reach it. The way that memory space is mapped in ZC is, to say the least, unique, and knowing what is limited, and in what way, is fundamental knowledge that I need to achieve some of what I want to do, without over-taxing the system. The fact that the compiler's errors aren't always accurate, and are often non-verbose, opens a can of worms in this area. I don't even know if the compiler would report that you've exceeded its maximum number of vars...

 

As I said, engineering, be it mechanical, electrical, electronic or software, shouldn't be a guessing game. If you're developing a theory, that;s another matter, as it involves varying levels of experimentation; but when something is known as fact, there's no reason for anyone to re-determine that datum.

 

 

I don't disagree with this. This is the software world though, and it is generally expected that you test code samples before asking about them because it is almost always inconsequential to do so.

If you were to ask such questions on StackOverflow, I'd imagine you'd get 'Is this homework?'

If I ever do my ZC documentation project (something I want to do most likely after The Last Emperor), it will take a lot of trial and error. Even if behavior is known, it should still be verified. That's good science and many classic experiments (including Faraday's) are still done to this day with the latest instruments.

I also agree with RetraRoyale in this instance. You do seem to lack an understanding of the basics.

 

I'm actually shocked, that you didn't try to argue that point.

 

With regard to testing code samples, I generally detail ideas, frameworks, or snippets. My codebase for one game is now over 17,000 lines, and testing sections of code independently, versus having someone check it, before I implement something that simply won't work, is a way to save what's left of my sanity. I retired from programming over a decade ago, primarily because I no longer derive  enjoyment from it; and tend to focus on the design of physical/tangible innovations, and inventions. I'm doing this, because no-one is going to do it for me:Its out of necessity. That;s also why I give away all of my work here, for as long as I had to do the work to make something function, I want to ensure that others needn't go through the process of re-creating something that already exists.

 

I also return the favour, on a regular basis, whether it be examining code posted by others, offering alternative methods, or writing entire script sets, to help out others who need assistance. It's not a one way, drainage of effort into the void; and when people don't have the time to assist, I eventually work it out; but as long as there is a community for this I see no problem in asking. It may not guarantee a response, but I'm not so lofty as to believe that i know everything, and I'm perfectly able to ask for assistance, even if that is no more than a syntax evaluation.

 

As I've said many times in the past, I am versed in an entirely different programming concept. Even so, in work environments, where we were using something like Fortran, it was very common to show code to associates for cross-checking, idea handling, and for improvement potential.

 

Usually when I post something, my question is simply: 'Does this look right?', and more often than not, it is. I ask, for the sake of verification: That doesn't mean that I don't try compiling it, even if i don't receive input. It does however allow me to ask people with more experience, if what I'm doing is incorrect, relative to the environment, or if there is a better way to do it. I will often give as much detail as possible, so that any answer is topical, and anyone willing to spend the time to examine what I'm doing, is able to completely comprehend my intent.

 

I also come from a generation, where everything was taught by example. All of the information needed to use something was included with it, in the documentation. You didn't need to read one reference, after another; as everything that you required was in one location

 

(The modern educational methods baffle, and bewilder me.)

 

I further don't bother with Stackoverflow, mostly due to the largely pretentious community-base. I do work with some other, small communities that make open-source software, and it's not uncommon to share examples, even in primitive form, for evaluation, critique, and checking. I can tell that there has been a strange paradigm shift, in the model of community-oriented programming in the last decade, with most people feeling that because they know something, everyone should know it, or they won't bother with them. That kind of attitude, is IMO, often counter-productive at best.

 

I still live, and work, in a world, where people work together, discuss ideas at length, and are willing to support one-another, to achieve a goal. Each person has their own unique strengths, weaknesses, vices, and virtues: The mutual support ensures that someone is always available to answer a question, do the needed research, or otherwise help to move things forward; and I see no problem with using that ideal here. People that assist me, receive he same in turn, when I can give it; and I likewise, assist others, who need help.

 

I don't feel myself 'above' that kind of community service, and I have a great deal of respect to others who feel likewise.


Edited by ZoriaRPG, 05 June 2014 - 01:28 PM.


#26 anikom15

anikom15

    Dictator

  • Banned
  • Real Name:Westley
  • Location:California, United States

Posted 05 June 2014 - 02:34 PM

SO is pretentious. I don't care for it (since it's all about mass opinion rather than actual discussion; anything with room for subjective opinions is closed as 'not constructive'), but 'is this homework?' is common across many communities. That was just one example.

As a suggestion, you should put pertinent, important questions first and put other less imperative questions at the end. Actually, you should ideally only ask one good question at a time. It makes it much easier for us to scan and give you answers. When I see a long list of questions, I often think 'someone else can handle this', but when I see good question, even if it's massive, I feel better at providing help.

Most of this comes from experience working with others on the Python mailing lists. The volume there is very high: hundreds of emails per day.

#27 Saffith

Saffith

    IPv7 user

  • Members

Posted 05 June 2014 - 04:04 PM

One thing on which I'm curious: When ZScript is compiled, is it compiled into the same format as ZASM, or is it different to that?

It's the same. You can even see the ZASM, if you like. Check the "Output ZASM code to allegro.log" box after compiling.
 

1. I was told ta long time back, at any global int,  float, or boolean, is limited to 256 maximum as a whole (i.e 256 total of all three types, in any combination.). That statement, did not include the crucial information: 'except when used as a function'.

A function that returns an int is not an int. The number of global variables is limited because there's a limited number of places to store them; functions don't need stored in the same way.

#28 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 06 June 2014 - 01:09 AM

SO is pretentious. I don't care for it (since it's all about mass opinion rather than actual discussion; anything with room for subjective opinions is closed as 'not constructive'), but 'is this homework?' is common across many communities. That was just one example.

As a suggestion, you should put pertinent, important questions first and put other less imperative questions at the end. Actually, you should ideally only ask one good question at a time. It makes it much easier for us to scan and give you answers. When I see a long list of questions, I often think 'someone else can handle this', but when I see good question, even if it's massive, I feel better at providing help.

Most of this comes from experience working with others on the Python mailing lists. The volume there is very high: hundreds of emails per day.

 

Aye, I know that the flow can be a disaster, in some of my posts. I do try to stress importance, but I also don't want to start threads for every single subject, individually. I'm probably the most patient person that I know, so I tend to be very diligent, in reading every last detail.

 

i do try to avoid questions that I don't find pertinent; and i try to give examples with my questions. Perhaps that is what you mean, by posting un-tested code. I post that, to give scope to my question, so that people can see my intent, and not just an empty, or open-ended question, that may have multiple types of applicability. That is an attempt to ensure that the answer is relative to my purpose; not because I don' t test code.

 

I test, and trace things, just like everyone else worth their salt, but when I don;t know the correct (or best) method, or some syntax structure, I post a question, with an example. In doing so, rather than just a flat answer, a person willing to give a full explanation, can take my example, and adjust it, with the answer, to also provide working samples of a method. I don't expect people to re-write everything, but it;s nice to see a visual example. This is how I learnt most things in life: Through use, with visual examples, or demonstrations.

 

I call this 'hands-on learning', and I feel it's one of the best educational method, and it;s very applicable in both academic, and work environments. When i train people, I don't give them a list of operations, I show them how to perform a task, as in doing so, there is no room for ambiguity. Take chemistry as an example:You can learn a formula, but if you don;t have the applied knowledge to use it, it;s meaningless. A demonstration on the correct method to achieve a desired result goes a long way, and tends to remain in memory.

 

I'm on an OS project mailing list, so i feel your pain.

 

 

It's the same. You can even see the ZASM, if you like. Check the "Output ZASM code to allegro.log" box after compiling.
 
A function that returns an int is not an int. The number of global variables is limited because there's a limited number of places to store them; functions don't need stored in the same way.

 

I've noticed that, but I wasn't certain if all instructions always had an equivalent.

 

Those ZASM code blocks, only print to the log when they occur though; isn't that correct? If some is there a way to get a full dump of the assembled code?

I see that; and now that I know that the compiler does differentiate, I feel much less constrained. I was acting on misleading information, which is why I think some kind of (pinned) technical FAQ would be useful.

 

How close was I, on my comprehension of the .sav file format, earlier? I'm pretty sure that it has 256 registers (or something similar), each of limited field size, in which it can store the values. (I did not, and still do not, think that it has anything to do with RAM allocation; as an active value in memory shouldn't be a problem, and that only the .sav format is constraining everything. Feel free to correct me, if the way that ZC allocates memory maps in RAM is also convoluted.) I see the prudence in this, and the difficulty in changing it, but I think that future releases will need to do so, in order to expand the capabilities of the editor into the future. That is, assuming that future releases will be backward-compaitble at all, at all.



#29 RetraRoyale

RetraRoyale

    Doyen(ne)

  • Members

Posted 06 June 2014 - 03:02 PM

Generally speaking, if there is no record of a limit for something, it is safer to assume there is no limit, rather than to assume it adopts the limits of something else. Nobody said how many functions you can have because there is no explicit limit to how many you can have. The ints, floats, and booleans are all the same thing in ZScript, so that's why they share limits. (In fact, 'float' is a misnomer, since they are really fixed point numbers, not floating point.) They are just values encoded in a predetermined size 'byte.'

 

Functions, however, can be arbitrarily long; they have no preset size. So naturally, they can't be stored and manipulated as easily as variables.



#30 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 06 June 2014 - 03:39 PM

Generally speaking, if there is no record of a limit for something, it is safer to assume there is no limit, rather than to assume it adopts the limits of something else. Nobody said how many functions you can have because there is no explicit limit to how many you can have. The ints, floats, and booleans are all the same thing in ZScript, so that's why they share limits. (In fact, 'float' is a misnomer, since they are really fixed point numbers, not floating point.) They are just values encoded in a predetermined size 'byte.'

 

Functions, however, can be arbitrarily long; they have no preset size. So naturally, they can't be stored and manipulated as easily as variables.

 

If it was just about anything else, I'd agree here; but ZC has a habit of imposing limits that aren't documented. Again, and I hope, for the final time, when i was told of the limits, the person who instructed me did not clarify that an int function wasn't bound by them. It was a plain statement, that all ints, floats, and ools have a cap of 256. That led to confusion on if ZQ treated int functions in the same manner, which sis why I made such heavy use of void functions in the past. (Much wasted time, effort, and energy.)

 

On a personal note, I also don't make a habit of being optimistic.

 

ZC does (for whatever reason) differentiate floats for some things, in the compiler, despite treating them in an identical manner internally. For example, a string array, is considered a float by the compiler, despite being declared, and used as an int. (This is most likely a reporting problem with the compiler itself.) Raw text is also interpreted as a float, when reporting errors.

 

I don't know why the compiler does this, but it does.

 

I take it that booleans are treated as simple 0/1 ints internally? If so, why doesn't an int of 0/1 cross to a bool of false/true, when typecasting?

 

I still believe that stating directly that there is no limit on functions, or on constants, would be prudent. For people like myself, who may draw incorrect conclusions, it;s useful knowledge to have available. It never hurts to provide that information, for if people don't need it, they'll ignore it, but if there is any room for doubt, a straightforward notation of facts could solve many problems. (I;d rather have more informationthan I need, than not enough information, that i may need...)


Edited by ZoriaRPG, 06 June 2014 - 03:48 PM.




Also tagged with one or more of these keywords: variables, limits, maximums, caps, global, variable, limit, maximum, cap, local

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users