On 21 June 2018 at 15:21, Dave Park via Ql-Users <ql-users@lists.q-v-d.com> wrote:
> > SuperBASIC is quite unique in that it stores the *difference* in length > of > > a line compared to the previous line, along with its line number. This > way, > > because the current line length is also stored in a system variable, it > can > > search for lines in both backward and forward direction. So a proc/fn > call > > will be faster when the definition is closer to the calling line. This is > > also mentioned in the Minerva documentation. > > Hmmm. Are they stored in a known order, eg: alphabetical or order of > creation/declaration > They are stored in order of line number (it's Basic, after all...). > > You cannot define a proc/fn multiple times but you can check the type and > > usage of a parameter using the PARTYP, PARUSE, PARNAM$ and PARSTR$ > > functions in TK2 and act accordingly. An example of this is in my 'ls' > > procedure which uses an extra parameter as a flag for recursive directory > > searches. When this parameter is empty it only lists the current > directory. > > I suppose it does reduce these stresses that while sBASIC has "strict" > typing of variables, it allows easy transfer between variable types. It > also has the concepts of undefined variables and defined but unset > variables. > It's not as strict as it seems. What's also unique in S*BASIC is 'coercion'. You want to assign a numeric value to a string variable and S*BASIC will happily do this, by converting the number to a string (in other BASICs you would have to use STR$). And the other way round assign a string value to a numeric variable (provided the string contains a valid number). The type of a parameter in a procedure or function is determined when the function is *called*, not when it's defined. In a machinecode function you can find out what type a parameter is and choose to evaluate it as a number, string or name (in a BASIC function you can use the four TK2 functions mentioned above though you're probably a bit more restricted by parameter types). Also, variables are never undefined (they're defined as soon as you enter their name in a program line) but they can be unset... > Quite amazing for a language that fit in a very small part of 48K. And all written in 68K assembler in a few weeks time... Jan. -- *Jan Bredenbeek* | Hilversum, NL | j...@bredenbeek.net _______________________________________________ QL-Users Mailing List