Recent Posts

Pages: [1] 2
1
News & Announce / ELENA sub reddit
« Last post by Alex Rakov on April 18, 2017, 04:58:11 am »
You may visit ELENA sub-reddit - https://www.reddit.com/r/elena_lang/
2
Tutorials / Tutorial: Stack allocated variables
« Last post by Alex Rakov on August 11, 2015, 05:43:26 am »
3
News & Announce / ELENA Twitter account
« Last post by Alex Rakov on August 04, 2015, 06:58:52 am »
ELENA Programming Language has a twitter account now - https://twitter.com/elena_language
4
News & Announce / ELENA 1.9.19.6 build (win32) is out
« Last post by Alex Rakov on July 15, 2015, 05:27:09 pm »
ELENA 1.9.19.6 build (win32) is out

A new build is available at http://sourceforge.net/projects/elenalang/files/ELENA%202.x/builds/

lib30 and the compiler are refactored
5
News & Announce / ELENA 1.9.19.5 setup blocked
« Last post by Alex Rakov on July 08, 2015, 08:38:40 am »
Windows blocks the downloaded setup from being executed.

You may either unblock the file or download zip archive.
6
News & Announce / ELENA 1.9.19.5 build (win32 / linux32) is out
« Last post by Alex Rakov on July 06, 2015, 04:20:54 pm »
ELENA 1.9.19.5 build (win32 / linux32) is out

A new build is available at http://sourceforge.net/projects/elenalang/files/ELENA%202.x/builds/

A lot of changes, lib30 is refactored, sqlite package
7
News & Announce / ELENA Source code migrated
« Last post by Alex Rakov on April 29, 2015, 12:33:27 pm »
ELENA source code was migrated to GitHub. SVN repository is now obsolete!

New repository address is now - http://github.com/ELENA-LANG/elena-lang

There are three branches: master (the latest release), current (a last stable build) and sandbox (work in progress)

The latest build is now available from github as well - http://github.com/ELENA-LANG/elena-lang/releases/tag/v1.9.19.4a
8
News & Announce / ELENA 1.9.19.4 build (win32 / linux32) is out
« Last post by Alex Rakov on April 28, 2015, 04:21:20 pm »
A new build is available at http://sourceforge.net/projects/elenalang/files/ELENA%202.x/builds/

$nil pseudo variable is added, to replace nil one.

In Linux version new examples are ported : goods, textfile, textdb

In Windows version gui samples added : agenda, c_a_g, graph

As usually any bug report is welcomed
9
Tutorials / Tutorial: Literal as an array of characters
« Last post by Alex Rakov on April 15, 2015, 08:33:11 am »
In this tutorial we will see how could we read the literal a character by character.

Let's consider the simple example: we will read each literal character and print it on the screen.

Code: [Select]
#define system.
#define extensions.

// ...

        #var l := "Hello world".
        #var i := 0.
        #loop (i < l length)?
        [
            console write:(l@i).
           
            i := i + 1.
        ].

So far so good. Let's now make our example a little bit more difficult:

Code: [Select]
        l := "Привет Мир".
        #var i := 0.
        #loop (i < l length)?
        [
            console write:(l@i).
           
            i := i + 1.
        ].

The first loop works but the second one fails.

Let's find what breaks our code.

Starting from 1.9.19 LiteralValue is UTF-8. So the literal is actually twice as long. All Russian characters are encoded by two bytes. So why the code was not broken in the first loop? Because CharValue is UTF-32. It has enough place to store any Unicode characters. But when we read the second byte CharValue raises the exception because the code is invalid.

Note that it would works well if "l" is WideLiteralValue. But we will have the similar problem for Chinese symbols.

Fortunately we could easily fix the problem if we will use CharValue.length method. It returns how much bytes it take to encode the symbol.

Code: [Select]
        i := 0.
        #loop (i < l length)?
        [
            console write:(l@i).
           
            i := i + l@i length.
        ].

Or we could use an enumerator:

Code: [Select]
        #var enum := l enumerator.
        #loop (enum next)?
        [
            console write:(enum get).
        ].

And the simplest way would be to use extensions'control helper:

Code: [Select]
       control run:l &forEach: ch [ console write:ch. ].
10
News & Announce / ELENA 1.9.19.3 build (win32 / linux32) is out
« Last post by Alex Rakov on April 12, 2015, 09:20:00 am »
A new build is available at http://sourceforge.net/projects/elenalang/files/ELENA%202.x/builds/

It includes several critical bug fixes (UTFxEncoder, elc2).

In Linux version new examples are ported : translit, matrix

In Windows version agenda sample is reintroduced (native implementation)

As usually any bug report is welcomed
Pages: [1] 2