mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
Deploy to GitHub Pages:
This commit is contained in:
@ -157,8 +157,9 @@ Since it has no dependencies this is simple, all the code in <code>src/</code> c
|
||||
<p><strong>’amalgamated’ build</strong> <br />
|
||||
If you want an even simpler way, there’s an ‘amalgamated’ build (often called <code>blob</code>, or <code>unity</code> builds.).
|
||||
This is <em>all of the wren source code in one file</em>.</p>
|
||||
<p>This file can be generated by running <code>python3 util/generate_amalgamation.py</code>, and the generated output will be in <code>build/wren.c</code>.
|
||||
Include <code>build/wren.c</code> and <code>src/include/wren.h</code> in your project code and you’re good to go.
|
||||
<p>This file can be generated by running <code>python3 util/generate_amalgamation.py > build/wren.c</code>,
|
||||
which saves the generated output in <code>build/wren.c</code>.</p>
|
||||
<p>Include <code>build/wren.c</code> and <code>src/include/wren.h</code> in your project code and you’re good to go.
|
||||
<small>Ideally later we can automate generating this and include it in the repo.</small></p>
|
||||
<hr />
|
||||
<p>If you run into bugs, or have ideas or questions, any of
|
||||
|
||||
@ -121,6 +121,14 @@ var hPosition = metalBand.indexOf("h")
|
||||
System.print(metalBand[hPosition]) //> h
|
||||
</pre>
|
||||
|
||||
<p>A string can also be indexed with a <a href="range.html">Range</a>, which will return a
|
||||
new string as a substring of the original. </p>
|
||||
<pre class="snippet">
|
||||
var example = "hello wren"
|
||||
System.print(example[0...5]) //> hello
|
||||
System.print(example[-4..-1]) //> wren
|
||||
</pre>
|
||||
|
||||
<p>If you want to work with a string as a sequence numeric code points, call the
|
||||
<code>codePoints</code> getter. It returns a <a href="sequence.html">Sequence</a> that decodes UTF-8
|
||||
and iterates over the code points, returning each as a number.</p>
|
||||
|
||||
Reference in New Issue
Block a user