<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/lua-github.git/testes/strings.lua, branch v5.4-beta</title>
<subtitle>github.com: lua/lua.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/'/>
<entry>
<title>Added macro 'luaL_pushfail'</title>
<updated>2019-08-16T17:58:02+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-08-16T17:58:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=b96b0b5abbf40cbdbed7952bf35a5a27ddf75928'/>
<id>b96b0b5abbf40cbdbed7952bf35a5a27ddf75928</id>
<content type='text'>
The macro 'luaL_pushfail' documents all places in the standard libraries
that return nil to signal some kind of failure. It is defined as
'lua_pushnil'. The manual also got a notation (@fail) to document those
returns. The tests were changed to be agnostic regarding whether 'fail'
is 'nil' or 'false'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The macro 'luaL_pushfail' documents all places in the standard libraries
that return nil to signal some kind of failure. It is defined as
'lua_pushnil'. The manual also got a notation (@fail) to document those
returns. The tests were changed to be agnostic regarding whether 'fail'
is 'nil' or 'false'.
</pre>
</div>
</content>
</entry>
<entry>
<title>Change in the syntax of attributes</title>
<updated>2019-07-30T15:18:19+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-07-30T15:18:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=0d529138042563baf260366e19a7aa2c60a07174'/>
<id>0d529138042563baf260366e19a7aa2c60a07174</id>
<content type='text'>
Attributes changed to posfixed ('x &lt;const&gt;', instead of '&lt;const&gt; x'),
and "toclose" renamed to "close". Posfixed attributes seem to make it
clearer that it applies to only one variable when there are multiple
variables.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Attributes changed to posfixed ('x &lt;const&gt;', instead of '&lt;const&gt; x'),
and "toclose" renamed to "close". Posfixed attributes seem to make it
clearer that it applies to only one variable when there are multiple
variables.
</pre>
</div>
</content>
</entry>
<entry>
<title>Change in the handling of 'L-&gt;top' when calling metamethods</title>
<updated>2019-07-26T17:59:39+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-07-26T17:59:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=b80077b8f3e27a94c6afa895b41a9f8b52c42e61'/>
<id>b80077b8f3e27a94c6afa895b41a9f8b52c42e61</id>
<content type='text'>
Instead of updating 'L-&gt;top' in every place that may call a
metamethod, the metamethod functions themselves (luaT_trybinTM and
luaT_callorderTM) correct the top. (When calling metamethods from
the C API, however, the callers must preserve 'L-&gt;top'.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of updating 'L-&gt;top' in every place that may call a
metamethod, the metamethod functions themselves (luaT_trybinTM and
luaT_callorderTM) correct the top. (When calling metamethods from
the C API, however, the callers must preserve 'L-&gt;top'.)
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed bug in 'string.format' with option '%f'</title>
<updated>2019-07-23T15:46:33+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-07-23T15:46:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=7f5c31cdcac5388b3c48a26112dfb6d2cadb7321'/>
<id>7f5c31cdcac5388b3c48a26112dfb6d2cadb7321</id>
<content type='text'>
As an example, 'print(string.format("%.99f", 1e70))' may have a
lot of garbage after the number.

The old test to ensure that 'string.format("%.99f", n)' was not too
large, 'fabs(n) &lt; 1e100', assumes that the number will fit in the 99
bytes; but the 99 is not the space for the number, it is the added
extra zeros.  The option worked for smaller numbers because of the
extra space added to MAX_ITEM.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As an example, 'print(string.format("%.99f", 1e70))' may have a
lot of garbage after the number.

The old test to ensure that 'string.format("%.99f", n)' was not too
large, 'fabs(n) &lt; 1e100', assumes that the number will fit in the 99
bytes; but the 99 is not the space for the number, it is the added
extra zeros.  The option worked for smaller numbers because of the
extra space added to MAX_ITEM.
</pre>
</div>
</content>
</entry>
<entry>
<title>Reviving HARDMEMTESTS</title>
<updated>2019-07-18T17:58:15+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-07-18T17:58:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=d36a31e6739bcd39c84f637344227af87cfd0ee5'/>
<id>d36a31e6739bcd39c84f637344227af87cfd0ee5</id>
<content type='text'>
This commit brings a new implementation for HARDMEMTESTS, which forces
an emergency GC whenever possible. It also fixes some issues detected
with this option:
  - A small bug in lvm.c: a closure could be collected by an emergency
  GC while being initialized.
  - Some tests: a memory address can be immediatly reused after a GC;
  for instance, two consecutive '{}' expressions can return exactly the
  same address, if the first one is not anchored.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit brings a new implementation for HARDMEMTESTS, which forces
an emergency GC whenever possible. It also fixes some issues detected
with this option:
  - A small bug in lvm.c: a closure could be collected by an emergency
  GC while being initialized.
  - Some tests: a memory address can be immediatly reused after a GC;
  for instance, two consecutive '{}' expressions can return exactly the
  same address, if the first one is not anchored.
</pre>
</div>
</content>
</entry>
<entry>
<title>Details</title>
<updated>2019-05-28T18:46:49+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-05-28T18:46:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=b293ae0577bebaca7169cb4f041b800641d5e2c4'/>
<id>b293ae0577bebaca7169cb4f041b800641d5e2c4</id>
<content type='text'>
- new error message for "attempt to assign to const variable"
- note in the manual about compatibility options
- comments
- small changes in 'read_line' and 'pushstr'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- new error message for "attempt to assign to const variable"
- note in the manual about compatibility options
- comments
- small changes in 'read_line' and 'pushstr'
</pre>
</div>
</content>
</entry>
<entry>
<title>A few more improvements in 'luaO_pushvfstring'</title>
<updated>2019-05-03T13:18:44+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-05-03T13:18:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=7c5786479c1d617ec7c133f2c2b955726436267a'/>
<id>7c5786479c1d617ec7c133f2c2b955726436267a</id>
<content type='text'>
- 'L' added to the 'BuffFS' structure
- '%c' does not handle control characters (it is not its business.
This now is done by the lexer, who is the one in charge of that
kind of errors.)
- avoid the direct use of 'l_sprintf' in the Lua kernel
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- 'L' added to the 'BuffFS' structure
- '%c' does not handle control characters (it is not its business.
This now is done by the lexer, who is the one in charge of that
kind of errors.)
- avoid the direct use of 'l_sprintf' in the Lua kernel
</pre>
</div>
</content>
</entry>
<entry>
<title>Some more small improvements to 'luaO_pushvfstring'</title>
<updated>2019-04-26T14:24:39+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-04-26T14:24:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=b36e26f51b117df98f0f5376f352c2381df3025f'/>
<id>b36e26f51b117df98f0f5376f352c2381df3025f</id>
<content type='text'>
Details:
- counter 'pushed' moved to the struct 'BuffFS'
- new auxiliar function 'getbuff' to build strings directly on
the buffer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Details:
- counter 'pushed' moved to the struct 'BuffFS'
- new auxiliar function 'getbuff' to build strings directly on
the buffer.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revamp of 'lua_pushfstring' / 'luaO_pushvfstring'</title>
<updated>2019-04-24T17:01:20+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-04-24T17:01:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=3da34a5fa70a51f0cf06d677a4f07b470693260c'/>
<id>3da34a5fa70a51f0cf06d677a4f07b470693260c</id>
<content type='text'>
The function 'luaO_pushvfstring' now uses an internal buffer to
concatenate small strings, instead of pushing all pieces on the
stack. This avoids the creation of several small Lua strings for each
piece of the result. (For instance, a format like "n: '%d'" used to
create three intermediate strings: "n: '", the numeral, and "'".
Now it creates none.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function 'luaO_pushvfstring' now uses an internal buffer to
concatenate small strings, instead of pushing all pieces on the
stack. This avoids the creation of several small Lua strings for each
piece of the result. (For instance, a format like "n: '%d'" used to
create three intermediate strings: "n: '", the numeral, and "'".
Now it creates none.)
</pre>
</div>
</content>
</entry>
<entry>
<title>New conversion specifier '%p' for 'string.format'</title>
<updated>2019-03-13T17:04:01+00:00</updated>
<author>
<name>Roberto Ierusalimschy</name>
<email>roberto@inf.puc-rio.br</email>
</author>
<published>2019-03-13T17:04:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/lua-github.git/commit/?id=dfebe439db76b5c9fd9b4e3877857e2449c8ad87'/>
<id>dfebe439db76b5c9fd9b4e3877857e2449c8ad87</id>
<content type='text'>
The call 'string.format("%p", val)' gives a Lua equivalent to the
C API function 'lua_topointer'.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The call 'string.format("%p", val)' gives a Lua equivalent to the
C API function 'lua_topointer'.
</pre>
</div>
</content>
</entry>
</feed>
