Qore Programming Language

  • Increase font size
  • Default font size
  • Decrease font size
Qore Release Notes

qore 0.8.3. RELEASE-NOTES

E-mail Print PDF

RELEASE NOTES for qore v0.8.3

release summary: 33 bug fixes and new feature support (including native Windows support)

  • BUG FIX: fixed a bug in parse_url() & parseURL(); parsing urls with IPv6 addresses without ":" - this will only work if a port number is included; otherwise raw IPv6 addresses must be enclosed in square brackets: [ipv6addr]
  • BUG FIX: fixed a bug in is_readable() - was returning True for all arguments
  • BUG FIX: fixed a file descriptor leak in the FtpClient class related to exception handling
  • BUG FIX: fixed some crashing memory bugs in socket handling (particularly related to the internal getPort() call)
  • BUG FIX: fixed split() with quote argument
  • BUG FIX: fixed a bug in handling parse errors in switch statements that caused an endless loop
  • BUG FIX: fixed 2 memory errors handling parse exceptions with regular expressions
  • BUG FIX: fixed an error in system() recognizing "$=" as shell meta-characters
  • BUG FIX: fixed a bug in system() where system() caused a deadlock in both child and parent processes if launching the child process launch fails
  • BUG FIX: fixed a bug in system() where quotes and backslashes were not being properly quoted
  • BUG FIX: fixed typeinfo handling with imported variables in many places - particularly subprograms with imported variables could fail to parse if %require-types is set in the subprogram
  • BUG FIX: fixed detected duplicate variables in the same block when %assume-local is set
  • BUG FIX: SQLStatement::commit() and SQLStatement::rollback() no longer throw an exception when called without an active statement; instead, the statement is closed and the operation is executed on the underlying database connection object (Datasource or DatasourcePool object)
  • BUG FIX: fixed a memory error looking up scoped constant values at parse time
  • BUG FIX: do not issue a "return value ignored" exception if the function/method could throw an exception - the usage without using the return value could be to test if an exception is raised (ie an exception would be considered a side effect)
  • BUG FIX: fixed the string output for dates (when date/time values are converted to a string) to not duplicate UTC offset information in case the associated time zone has no region name
  • BUG FIX: fixed a bug in the c++ function QoreString::replaceAll()
  • BUG FIX: fixed a crash when parsing a class with an unknown/undefined base class
  • BUG FIX: fixed a memory leak in the Socket class static initialization
  • BUG FIX: fixed issues with passing a reference through different program stacks
  • BUG FIX: fixed a bug where some specific type errors in function or method calls were not found at parse time, but rather only at bug time - now these errors are found at parse time
  • BUG FIX: added stack overrun check in QoreClass::execConstructor() call to catch the case when a class instantiation is recursively defined
  • BUG FIX: fixed a crash due to a memory error in managing reference cycles with closures assigned to constant containers
  • BUG FIX: fixed a crash when referencing closure-bound local variables in expressions executed by the background operator
  • BUG FIX: fixed function/method variant matching to ensure that variants are matched at run time if there is a variant with fewer parameters than arguments in the call, but the arguments could be NOTHING (count these as ambiguous matches)
  • BUG FIX: fixed 2 extremely tricky bugs where deleting a global-thread-local and closure-bound variable that causes an object to go out of scope that in turn references the variable int its destructor caused a crash due to improper thread-local variable stack deletion
  • BUF FIX: fixed a deadlock when deleting the old value of the closure-bound global-thread-local variable while holding the variable's lock (happened when the value was an object that referenced the variable in the destructor)
  • BUG FIX: implemented variable finalization to ensure that variables are not assigned after they are destroyed during program and thread termination and destruction - this fixed some possible memory leaks in QoreProgram destruction
  • BUG FIX: implemented sleep() and usleep() with nanosleep() (on all platforms with nanosleep(); also no longer mask SIGALRM as it may be used by a library; SIGALRM is also needed for sleep() and usleep() on UNIX and UNIX-like platforms; this eliminated some strange crashes due to unhandled SIGALRM signals when qore is used with some 3rd party libraries
  • BUG FIX: added QDOM_FILESYSTEM to all static File class methods (so they cannot be called while "no-filesystem" restrictions are in place for a Program object)
  • BUG FIX: added QDOM_TERMINAL_IO to TermIOS::getWindowSize() (so it cannot be called while "no-terminal-io" restrictions are in place for a Program object)
  • BUG FIX: added runtime checks for method calls to system File class constants while "no-terminal-io" is in force (so they cannot be called while "no-terminal-io" restrictions are in place for a Program object)
  • BUF FIX: fixed a crashing bug where a hash passed to the context statement will cause a crash if one of the keys after the first is not assigned to a list
  • new feature: Qore is now supported on Windows with a native DLL and binaries; see README-WINDOWS for more information
  • new feature: parse defines are now supported for conditional parsing in a very simple way similar to a very simplified form of the C/C++ pre-processor.  All option (HAVE_*) are now supported as parse defines as well (they are defined only if they are True):

    new parse directives supporting parse defines:

    • %define
    • %ifdef
    • %ifndef
    • %else
    • %endif

    new Program methods supporting parse defines:

    • Program::define()
    • Program::getDefine()
    • Program::isDefined()
    • Program::undefine()
  • new feature: new softlist and *softlist types for automatically converting values to a list
  • new feature: FtpClient class enhancements:

    new methods

    • FtpClient::mkdir()
    • FtpClient::rmdir()
    • FtpClient::putData()
  • implemented implicit connection handling for the FtpClient class

  • new feature: Program class enhancements:
  • new method: Program::replaceParseOptions()

    also expanded the parse option checking logic to allow parse options to be set even when options are locked, if the options make the Program's option environment more restrictive

  • new feature: added a new argument to split(string, string);now it's split(string, string, bool = False) - if the 3rd arg is True then the separator pattern string will be included in each element of the output list
  • new feature: do not issue "duplicate-local-vars" warning when the other var is a top-level (thread-) local var
  • new feature: include "deprecated" in the default warning mask
  • new feature: added WARN_DEFAULT constant
  • new feature: new command-line options for the qore executable:
    • --time-zone,-z (set default time region)
    • --define, -D   (create a parse define)
  • new feature: thread-local variables are now persistent in each Program object; they do not disappear between calls to Program::run() or Program::callFunction(), etc
  • new feature: allow SQLStatments to go from state 'defined' (retrieving select after exec) to 'executed' automatically without forcing the user to call SQLStatement::close()
  • new feature: new functions:
    • strmul(string, int, *int)
    • has_key()
  • new feature: parser improvements: implemented parser error recovery for syntax errors in argument list declarations
  • new feature: added support for removing or deleting a list of keys from a hash in a single atomic operation:
    • my hash $h = remove $hash.$list_of_keys;
    • delete $hash.("a", "b", "c")
  • new feature: allow parameters to be declared with type "nothing"
  • doc updates: documentation updated for new features, documentation corrections
Last Updated on Monday, 17 October 2011 15:27
 

Qore 0.8.2 RELEASE-NOTES

E-mail Print PDF

RELEASE NOTES for qore v0.8.2

release summary: 16 bug fixes, IPv6 support, and other minor improvements

  • BUG FIX: fixed a crash when calling exit() right after fork() in the parent process by ensuring that the signal thread is stopped before exit()ing
  • BUG FIX: fixed parse option inheritance with Program objects; when PO_NO_CHILD_PO_RESTRICTIONS is set, then take the parse option argument to Program::constructor() and apply them literally to the new Program object (before the parse options were ignored and the parse options applied to the child were applied from unitialized memory)
  • BUG FIX: fixed a memory/reference leak in the remove operator
  • BUG FIX: fixed a bug initializing the internal signal manager related to static C++ initialization ordering
  • BUG FIX: fixed some bugs with %new-style with variable declaration lists
  • BUG FIX: fixed typos in statvfs hash output
  • BUG FIX: fixed constant resolution when a class constant refers to other (unscoped) class constants in the constant's definition
  • BUG FIX: fixed catch block parameter parsing when %allow-bare-refs is set
  • BUG FIX: Dir::openFile() return type corrected to "File"
  • BUG FIX: fixed memory errors merging in exception thrown when executing code at parse time to the run-time exception sink
  • BUG FIX: fixed initializing case expressions requiring parse-time evaluation
  • BUG FIX: fixed the SQLStatement class to perform an auto-commit if necessary when the statement is closed when used with a Datasource with auto-commit enabled
  • BUG FIX: fixed (with an override) RWLock::lockOwner() to return True if the read lock is held
  • BUG FIX: the SQLStatement class did not set the "in transaction" flag when executing SQL; this could cause the transaction state to be silently lost when a driver does a reconnect with a lost connection
  • BUG FIX: the internal c++ Datasource class did not set the "active transaction" flag properly with the first exec
  • BUG FIX: added -lthread to sparc8 builds
  • new feature: IPv6 support: Socket class updated, parseURL(), and parse_url() updated to work with IPv6 addresses and hostnames
  • new feature: added Socket::getPeerInfo() and Socket::getSocketInfo() methods to get verbose information about local and remote sockets
  • new feature: getaddrinfo() function and related constants to get network address information for hostnames and services
  • new feature: added statvfs() function
  • new feature: added normal methods: Dir::hstat(), Dir::stat(), Dir::statvfs()
  • new feature: added normal methods: File::stat(), File::hstat(), File::statvfs(); added static methods: File::stat(), File::lstat(), File::hstat(), File::hlstat(), File::statvfs()
  • new feature: added the %y printf format specifier to give YAML-like output for complex data structures
  • new feature: added RWLock::writeLockOwner() and RWLock::readLockOwner() methods
  • new feature: added date_info() function with 2 variants to get broken-down date/time information
  • new feature: added FtpClient::rename() method
  • new feature: removed restriction assigning function references to constants
  • new feature: added trunc_str() function for more efficient trimming a multi-byte string to a certain maximum byte length
  • new feature: added a new DBI method: selectRow() and capability (DBI_CAP_HAS_SELECT_ROW); this allows drivers to efficiently select only one row from a select statement; if more than one row is returned, then an exception should be raised and the data not actually returned from the DB server; if the DBI driver does not implement this function, then the Qore library will emulate this behavior with selectRows()
  • new feature: added timestamp to default exception handler output
  • new feature: when the debugging compile-time option is enabled, then simple backtraces are supported in specific places that will assert on Linux and OSX
  • doc updates: content was added for new and existing features and corrections were made

 

 

Qore 0.8.1 RELEASE-NOTES

E-mail Print PDF

RELEASE NOTES for qore v0.8.1 aka "Talking Barnacle"

release summary: major bugfixes and major new features including the new prepared statement API, vastly improved type system, static class variables and class constants

  • COMPATIBILITY WARNING: removed all XML and JSON functionality to the new "xml" and "json" modules; see README-MODULES for more information
  • BUG FIX: fixed a deadlock when calling HTTPClient::setProxyURL() with an empty string argument
  • BUG FIX: fixed a bug in the return statement to not check return type if an exception is active
  • BUG FIX: fixed a crashing bug when on_exit, on_success, or on_error statement bodies are empty ({})
  • BUG FIX: fixed command-line to take modules loaded on the command-line and apply them immediately to the program; previously the modules would be loaded but only accessible in the parsed program if the program also had a %requires declaration for the same module as well
  • BUG FIX: fixed a bug in QoreClass initialization from modules that could cause a crash
  • BUG FIX: updated time zone initialization to parse /etc/TIMEZONE on solaris if the TZ variable is not set to set the time zone
  • BUG FIX: made all Socket read methods taking a timeout throw a SOCKET-TIMEOUT exception instead of returning NOTHING
  • BUG FIX: fixed SSL read timeouts with Socket::recv*()
  • BUG FIX: fixed 2-byte bitop swap on MSB platforms (ex sparc)
  • BUG FIX: fixed DatasourcePool::constructor(hash), was ignoring "max" option and setting to default (20)
  • BUG FIX: fixed the setegid() function, was non functional before
  • BUG FIX: fixed and improved parse-time variant matching
  • BUG FIX: fixed a bug where it was possible to declare a function/method/ closure with a return type and then not have a return statement as the last statement in the block thereby exiting with return value NOTHING, which could cause a crash
  • BUG FIX: implemented run-time checking when NOTHING is returned from a function, method, or closure that declares a return type
  • BUG FIX: fixed a bug in Dir::mkdir()
  • BUG FIX: fixed sign error with not found strings with index() and rindex() functions
  • BUG FIX: fixed a bug with object += hash; member types were not checked which could allow for members to be assigned types in violation of their declared types
  • BUG FIX: fixed a bug where too-lax type checking when executing variants resolved at parse time can lead to a crash when a call is made with a runtime type error
  • BUG FIX: fixed a deadlock where if a global variable contains an object which is deleted when the global var is reassigned and the object's destructor references the containing global variable, a deadlock could result due to incorrectly running the object's destructor while the global variable's lock is held
  • BUG FIX: fixed incompatibility with string "splice" and "extract" operators; they were ignoring the 4th argument if it was not a string
  • BUG FIX: fixed invalid memory access after delete error
  • BUG FIX: removed internal references to the non-thread-safe localtime() function; use thread-safe Qore internal date/time APIs instead
  • BUG FIX: fixed %require-types checking with local variable declarations
  • BUG FIX: fixed a memory leak/error when a namespace is added to a namespace list and a committed namespace of the same name already exists, the committed namespace is leaked and replaced with the parsed namespace (happened in the parseCommit stage)
  • BUG FIX: fixed race condition in ManagedDatasource without connection lock when grabbing transaction lock - previously (without the connection lock, which was recently removed) the startDBAction function did not guarantee exclusive access to the datasource
  • BUG FIX: fixed a memory/reference leak with thread resource tracking with the Datasource class
  • BUG FIX: the Datasource class will no longer allow read-only access to the Datasource from other threads when a thread holds the transaction lock because access to uncommitted data would be possible
  • BUG FIX: fixed DatasourcePool destruction with a transaction open in current thread
  • BUG FIX: fix in the Dir class for stat()'ing symbolic links
  • BUG FIX: bug fix for Socket class to enable the descriptor to be 0 (a valid socket descriptor); before this would fail with strange errors
  • BUG FIX: fixed constant initialization, parse intiialization order, and global thread-local variable access from code parsed and committed to the Program object after the first commit
  • BUG FIX: fixed connecting to a HTTPS server through a proxy by using the HTTP CONNECT method with the proxy
  • BUG FIX: fixed bugs in FtpClient class handling invalid responses from buggy FTP servers
  • BUG FIX: fixed socket read when socket is closed during a read(-1) or readBinary(-1) operation; an exception was thrown instead of returning the data that was already read
  • BUG FIX: added internal C++ API function Datasource::activeTransaction() so DBI drivers can see if they need to throw an exception or not when automatically reconnecting to a dataource - if Datasource::beginTransaction() is called and then the driver finds out the connection is down, it is safe to reconnect silently if no DB commands have been issued since the beginTransaction() call - Datasource::activeTransaction() will only return true if DB commands have been issued since the transaction started.  All DBI drivers the support auto-reconnect were separately updated as well to use the new API
  • BUG FIX: warnings and parse options are now stored on each statement so that they are applied in the same way during both parse stages
  • new feature: class constants; classes can now declare constants in their private and public declaration blocks, for example:
class Test {
public {
const FileName = "input.xml";
}

private {
const limit = 100;
}
}
  • new feature: static class variables; classes can now declare static variables in their private and public declaration blocks, for example:
class Test {
public {
static string lastFile = "none";
}

private {
static int numProcessed = 0;
}
}
  • new feature: much better type implementation
  • new type "timeout": accepts either integer or date (also *timeout)
  • new type "data": accepts either binary or string (also *data)
  • types prefixed by "*" mean "or nothing" - also allow assignments to NOTHING
  • new feature: SQLStatement class and internal prepared statement API for DBI drivers; the first driver supporting the new prepared statement API is the Oracle driver
  • new feature: fixed in-object calls (ex: $.call()) to dynamically look up the method if the run-time class is not the same as the parse class.  This means that it's no longer necessary to use the "$self.method()" syntax to make calls when the method may be called by a child class that has reimplemented the method
  • new feature: new parse options:
  • %assume-local: variables declared with type and without "my" are assumed to be local variables
  • %allow-bare-refs: allows all variables, object members, and object method calls to be made without using "$" or"$."
  • %new-style: combination of %assume-local and %allow-bare-refs
Here are some examples with %new-style:
for (int i = 0; 0 < elements; ++i) {
}
Mutex m();
m.lock();
on_exit m.unlock();

declaring a function with argument types, default argument values and return types:
ex:

 string sub example(int i = 0, bool force = False) {
  return "test";
 }
  • new feature: return types for functions, methods, and closures can appear before the function signature:
   int sub function() {}

the new syntax with the return type before the method signature is preferred over the olf syntax with the "returns" keyword

  • new feature: implemented warning "duplicate-block-vars" enabled by default for the case when a variable is declared twice within the same block at the exact same lexical scope; this is an error when %assume-local is enabled
  • new feature: implemented "#$" giving the implicit offset when implicitly iterating a list (foreach, map, foldl, foldr, select)
  • new feature: added the following methods to the HTTPClient class:
  • HTTPClient::setUserPassword()
  • HTTPClient::clearUserPassword()
  • HTTPClient::setProxyUserPassword()
  • HTTPClient::clearProxyUserPassword()
  • new feature: added "perm" key to stat hash output giving the file's symbolic permission (i.e. "drwxr-xr-x")
  • new feature: implemented %module-cmd(<module-name>) parse directive to allow modules to handle commands while parsing; first module using this is the gnu-java module for "import" statements allowing java classes (to be imported to the current program)
  • new feature: implemented "deprecated" method and function tag
  • new feature: implemented splice(string, string, string) to split with an optional quote character; this can be used, for example, to quickly parse CSV files where some fields may be quoted and some not
  • new feature: added methods:
  • AbstractSmartLock::lockOwner()
  • AbstractSmartLock::lockTID()
  • new feature: updated HTTPClient to accept URLs specifying UNIX domain sockets
Last Updated on Monday, 27 December 2010 15:27
 

Qore 0.8.0 RELEASE-NOTES

E-mail Print PDF

RELEASE NOTES for qore v0.8.0 aka "Hard Qore"

release summary: major Qore release with significant new functionality; see below for compatibility warnings

  • hard typing, function and method overloading, and default argument values

declaring a variable with type info:
ex:

      our int $i = 1;
      # the following 2 are functionally identical
      my Mutex $m = new Mutex();
      my Mutex $m();

declaring a function with argument types, default argument values and return types:
ex:

 sub example(int $i = 0, bool $force = False) returns string {
  return "test";
 }


builtin types: int, float, bool, string, hash, object, reference, binary, date, nothing, null

soft types:
softint: converts automatically from string, float, bool, and date
softbool: converts automatically from string, float, int, and date
softstring: converts automatically from int, float, bool, and date
softfloat: converts automatically from string, int, bool, and date

composite types:
data: either string or binary
any: any value (including nothing)
code: either a call reference or a closure

the special type names "callref" and "closure" are synonyms for "code" and cannot be used to restrict a value to one or the other types.

limitations of hard typing:
no complex types are available yet (reference to hash, list of Condition, etc).
many functions and methods can return more than one data type depending on the arguments (values, not types); in this case the return types are tagged as "any" even though only a small number of types can be returned.  In general, whenever an expression can return more than one type, this is currently covered by returning type "any".

Type information has been propagated through the parser; so many more errors can be caught at parse time, sometimes even if types are not declared in code (such as with code written for older versions of qore, for example).  See below for warnings (non-existent-method-call, invalid-operation, call-with-type-errors, return-value-ignored, deprecated, excess-args, duplicate-hash-key) and parse directives (ex %require-types) added, most of them related to typing.

class methods restrictions: the following methods may not be overloaded:
<class>::copy()
<class>::destructor()
<class>::memberNotification(string $member)
<class>::memberGate(string $member)
<class>::methodGate(string $method, ...)

  • time zone support in absolute date/time values

Qore uses the system's zoneinfo information to determine the UTC offset and daylight saving's time changes
Dates given without a time zone portion are assumed to be in local time

  • more flexible time input when parsing:

UTC offset in time east plus hundreths of a second (1-6 digits after the decimal point are accepted):
2001-01-01T11:35:21.53+06:00

date in Zulu time (UTC) (time component = 00:00:00Z)
2001-01-01Z

  • date/time values have resolution to the microsecond

previously was to the millisecond; applies to both relative and absolute date/time values

parser accepts a new relative time format: <x>us, ex: 45us = 45 microseconds

  • conversion to a date from a string is much more flexible

formats such as the following are now accepted:

2001-01-01T15:35:23         # 2001-01-01 15:35:23 Mon +01:00 (CET)
20010101 15:35:23Z          # 2001-01-01 15:35:23 Mon Z (UTC)
20010101 153523Z            # 2001-01-01 15:35:23 Mon Z (UTC)
20010101 153523-02          # 2001-01-01 15:35:23 Mon -02:00 (-02:00)
20010101 153523-02:00:00    # 2001-01-01 15:35:23 Mon -02:00 (-02:00)
2001-01-01-153523-020000    # 2001-01-01 15:35:23 Mon -02:00 (-02:00)
20010101-153523             # 2001-01-01 15:35:23 Mon +01:00 (CET)

etc

furthermore, it's now possible to directly specify relative date/time values when converting from a string using a subset of ISO-8601 duration formats with an extension for microseconds (<n>u - the 'u' is lower-case as it is not part of the ISO9601 standard) and also an extension where the numeric portion may be negative:

P<n>Y<n>M<n>DT<n>H<n>M<n>S<n>u


for example:

P1Y2MT4H                    # <time: 1 year 2 months 4 hours>
P4DT-2M15u                  # <time: 4 days -2 minutes 15 microseconds>
PT4H30M                     # <time: 4 hours 30 minutes>


note that there must be at least one time component, and the <n>M value is minutes when following the 'T' and months when preceding or in the absense of a 'T'.
unlike ISO-8601 durations, all numbers must be integers (ISO-8601 allows the smallest time unit given to have a fractional component)

The other duration format: PYYYY-MM-DDTHH:MM:SS is also still accepted as well as in previous versions of qore

  • class constuctor methods can now be declared private

  • new TimeZone class

# creates a TimeZone object based on a zoneinfo region file
TimeZone::constructor(string)

# creates a TimeZone object based on a UTC offset in seconds east of UTC
TimeZone::constructor(softint)

# returns a date marked with this TimeZone from the UTC offset in seconds
TimeZone::date(softint $epoch_seconds, softint $us = 0)

# returns a date marked with this TimeZone
TimeZone::date(date)

# returns a date marked with this TimeZone from the given argument as an epoch offset in milliseconds
TimeZone::dateMs(softint)

# returns a date marked with this TimeZone from the given argument as an epoch offset in microseconds
TimeZone::dateUs(softint)

# returns the time zone for the current execution context
static TimeZone::get() returns TimeZone

# allows the time zone to be set for the current execution context
static TimeZone::set(TimeZone) returns nothing

# sets the time zone according to a UTC offset in seconds east of UTC for the current execution context
static TimeZone::setUTCOffset(softint) returns nothing

# sets the time zone according to a zoneinfo region file for the current execution context
static TimeZone::setRegion(string) returns nothing
  • new Program methods

Program::setTimeZoneRegion(string)
Program::setTimeZoneUTCOffset(softint)
Program::setTimeZone(TimeZone)
Program::getTimeZone() returns TimeZone
  • new functions

getpwuid2(softint) returns hash
getpwnam(string) returns any
getpwnam2(string) returns hash
getgrgid(softint) returns any
getgrgid2(softint) returns hash
getgrnam(string) returns any
getgrname2(string) returns hash
readlink(string) returns string
is_date_relative(date) returns bool
is_date_absolute(date) returns bool
get_duration_seconds(date) returns int
get_duration_milliseconds(date) returns int
get_duration_microseconds(date) returns int
now_us() returns date
now_utc() returns date
date_us(softint) returns date
microseconds(softint) returns date
get_microseconds(date) returns int
get_epoch_seconds(date) returns int
setsid() returns int
  • new overloaded variants of existing functions

gmtime(date) returns date
localtime(date) returns date
  • new Socket methods and variants

Socket::connectINET(string $host, int $port, int $timeout_ms = -1) returns nothing
Socket::connectINET(string $host, int $port, date $timeout_ms) returns nothing
Socket::connectINETSSL(string $host, int $port, int $timeout_ms = -1) returns nothing
Socket::connectINETSSL(string $host, int $port, date $timeout_ms) returns nothing
Socket::connectUNIX(string $path) returns nothing
Socket::connectUNIXSSL(string $path) returns nothing
Socket::setCertificate(binary) returns nothing
Socket::setCertificate(string) returns nothing
Socket::setPrivateKey(binary) returns nothing
Socket::setPrivateKey(string) returns nothing
  • new object creation syntax

to create an object without explicitly using the "new" operator, use the "my" or "our" keywords then give the class name followed by the arguments to the constructor in parentheses as in the following example:
my File $f();

  • cast<> operator

This operator can be used to suppress warnings such as the non-existent-method-call warning; for example, if you make a method call from a base class to a method that only exists in a subclass, because qore has no way of defining "pure virtual" methods like in C++, the parser raises a "non-existent-method-call" warning.  You can use the cast<> operator to supress this warning as in the following example:
cast<ChildClass>($self).methodCall();

  • delete statement is now the delete operator

so now the delete operator can be used in "map" expressions, for example

  • new remove operator

the remove operator works in a way similar to the delete operator, but does not call the destructor when operating on objects.  It also returns the value removed.
For example:

 my string $str = remove $hash.key;

This would remove "key" from $hash and return the value removed.

  • new extract operator

The extract operator is identical to the "splice" operator, except the extract operator returns any values removed from the list or string operated on

  • constants may be assigned with any expression that does not have side effects

this includes builtin functions that have been tagged as safe to use in constant expressions

  • fixed the ',' operator's precedence in the parser

previously the comma operator's precedence was set far too high which caused problems in certain expressions, for example:

func(1, $a = 2, 3)

would previously be interpreted like this:

func(1, ($a = 2, 3))

contrary to what any reasonable programmer would expect.  From this version on, the comma operator's precedence has been adjusted to be like other programming languages.

  • fixed conversion of characters quoted with '\' in JSON strings

  • changed output of printf format specifiers %n and %N

double quotes (") and '\' characters are now quoted with '\' in strings

  • new warning: non-existent-method-call

raised when a given method name cannot be found in the current class or base classes.  such calls may be valid if the method itself is called from a derived class where the method exists

  • new warning: invalid-operation

warns when an expression will produce a constant output due to type errors

  • new warning: call-with-type-errors

warns when a variant tagged with RT_NOOP is resolved at parse time

  • new warning: return-value-ignored

warns when a function or method that only returns a value and has no side effects has its return value ignored

  • new warning: deprecated

warns when deprecated features are accessed

  • new warning: excess-args

warns when excess arguments are passed to a variant that does not access the excess arguments

  • new warning: duplicate-hash-key

warns when a duplicate hash key is given in an immediate literal hash

  • default warning mask updated

the default warning mask includes: unknown-warning, unreachable-code, nonexistent-method-call, invalid-operation, call-with-type-errors, return-value-ignored, duplicate-hash-key

  • new parse option PO_REQUIRE_TYPES (%require-types), command-line --require-types

if this option is given, then all parameters, return types, and object members must have a declared type
if no return type for functions and methods is explicitly declared when this option is set, then the return type is assumed to be NOTHING
this option also implies PO_STRICT_ARGS

  • new parse option PO_STRICT_ARGS (%strict-args), command-line --strict-args

when this option is set, no variant tagged with RT_NOOP is accessible; any access to variants with this tag at parse-time or at runtime will result in an exception
Additionally, if excess arguments are sent to a function or method that does not access excess arguments, an exception is raised

  • new parse option PO_NO_THREAD_INFO (%no-thread-info), command-line --no-thread-info, domain QDOM_THREAD_INFO

the following functions were tagged with QDOM_THREAD_INFO:

gettid(), num_threads(), thread_list(), get_thread_data(), get_all_thread_data(), getAllThreadCallStacks()

 

  • new parse option PO_NO_EXTERNAL_INFO (%no-external-info), command-line --no-external-info, domain QDOM_EXTERNAL_INFO

the following functions were tagged with QDOM_EXTERNAL_INFO:

getuid(), geteuid(), getgid(), getegid(), getpid(), getppid(), gethostname(),
gethostbyname(), gethostbyaddr(), gethostbyname_long(), gethostbyaddr_long(),
getcwd(), getcwd2(), getpwuid(), getpwuid2(), getpwnam(), getpwnam2()

 

  • new parse option PO_NO_LOCALE_CONTROL (%no-locale-control), command-line --no-locale-control, domain QDOM_LOCALE_CONTROL

the following functions were tagged with QDOM_LOCALE_CONTROL:

TimeZone::set()

 

  • parseDatasource() function updated

parseDatasource() will now parse options at the end of a datasource string in curly brackets ('{' '}') such as the following:
oracle:user/pass@db(al32utf8)%localhost:1521{min=5,max=10}

Any option name can be placed there, whitespace is ignored; options must have the form <key>=<value>

Options are placed in a hash under the "options" key in the value returned from parseDatasource().
The example above would produce the following output:

hash: (8 members)
 type : "oracle"
 user : "user"
 pass : "pass"
 charset : "al32utf8"
 db : "db"
 host : "localhost"
 port : 1521
 options : hash: (2 members)
 min : "5"
 max : "10"

 

Only "min" and "max" options are now currently used - when the DatasourcePool(hash) constructor is used are these options respected if they are present in the hash.

  • new Datasource constructor variant:

Datasource::constructor(hash)

expects a hash as produced by parseDatasource()

  • new DatasourcePool constructor variant:

DatasourcePool::constructor(hash)

expects a hash as produced by parseDatasource()

  • HTTP-CLIENT-RECEIVE-ERROR exception

now returns more information - the exception argument "arg" is a hash with the following keys:
code: the HTTP code received
body: the message body received

  • HAVE_TIMEGM is always true

we no longer use the system function timegm(), so this option (and constant) is always true now
timegm() is now an alias for get_epoch_seconds()

  • new constants

MACHINE_MSB: boolean, True if the machine is a big-endian machine, False if not
Z_DEFAULT_COMPRESSION: integer; the default compression level for zlib

  • module blacklist

qt-core, qt-gui, qt-svn, and qt-opengl are all blacklisted because they were implemented with faulty namespace handling that does not work with qore 0.8.0+; use the 'qt4' module based on libsmoke instead; it's much more complete and supports types, etc

  • COMPATIBILITY WARNING: HTTPClient::setSecure(bool $b = True)

before calling this method without an argument would turn off secure connections, which was counter-intuitive

  • COMPATIBILITY WARNING: HTTPClient::setProxySecure(bool $b = True)

before calling this method without an argument would turn off secure connections, which was counter-intuitive

  • COMPATIBILITY WARNING: HTTPClient::setNoDelay(bool $b = True)

before calling this method without an argument would turn off TCP_NODELAY, which was counter-intuitive

  • COMPATIBILITY WARNING: Socket::setNoDelay(bool $b = True)

before calling this method without an argument would turn off TCP_NODELAY, which was counter-intuitive

  • COMPATIBILITY WARNING: method return values updated

Datasource::open(), Datasource::close(), Datasource::commit(), Datasource::rollback(), DatasourcePool::commit(), DatasourcePool::rollback(), 
FtpClient::connect(), FtpClient::disconnect(), FtpClient::cwd(), FtpClient::get(), FtpClient::put(), FtpClient::del(), Socket::shutdownSSL()

no longer return any value.  In previous versions they would return integer 0.  However, they always throw an exception if there is an error, so any return value was meaningless.

 

Qore 0.7.8 RELEASE-NOTES

E-mail Print PDF

RELEASE NOTES for qore v0.7.8

release summary: 19 bug fixes from 0.7.7
  • BUG FIX: fixed a bug processing arguments to in-object method calls in the background operator
  • BUG FIX: fixed a bug processing arguments to static method calls in the background operator
  • BUG FIX: fixed a bug where the File class would reset the encoding given in the constructor on ::open*()
  • BUG FIX: fixed a bug where if local variables were used in a reference expression with the background operator, whenever the reference was accessed in the called code a crash would result
  • BUG FIX: eliminated string parsing in block comments, fixed a bug where the parser was not terminated at EOF in a block comment
  • BUG FIX: check for PO_NO_FILESYSTEM in FtpClient::put()
  • BUG FIX: fixed a cosmetic bug in exception string in FtpClient::get()
  • BUG FIX: fixed a bug in SSLCertificate::getSignature()
  • BUG FIX: fixed a bug in SSLCertificate::getInfo()
  • BUG FIX: fixed CANNOT-PROVIDE-FEATURE exception text
  • BUG FIX: fixed getpwnam() to use q_getgrnam() and correct a thread and functional error in QC_Dir.cc
  • BUG FIX: fixed non-thread-safe usage of getpwnam() in QC_Dir.cc
  • BUG FIX: fixed adding virtual private data to classes with multiple virtual base classes
  • BUG FIX: fixed Socket::recv() and Socket::recvBinary() when reading all data available on the socket when the remote ends closes the connection in an orderly way
  • BUG FIX: fixed parsing negative numbers in json strings
  • BUG FIX: fixed limited XML node size
  • BUG FIX: fixed a memory bug in the context statement when an exception occurs in the context expression
  • BUG FIX: fixed a memory bug in the binary += operation; if the operand for BinaryNode::append() is equal to the current buffer, a crash would result
  • BUG FIX: fixed some bugs processing arguments in the XmlReader class
  • enhancement: added a QoreSocket::recvBinary() function to receive all data available on the socket (with an optional initial timeout value) and return it as a binary object; if Socket::recvBinary() is called with buffer-size <= 0, then this variant is used
Last Updated on Tuesday, 20 April 2010 12:13
 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  3 
  •  4 
  •  Next 
  •  End 
  • »


Page 1 of 4