Ela Platform 2016.3 is released

42 views
Skip to first unread message

vorov2

unread,
Mar 21, 2016, 10:28:38 AM3/21/16
to elalang

Ela Platform 2016.3 is an iterative release that focuses on Ela standard library. The major change is an addition of a "measure" module that

provides a support for measurement units in Ela.

This platform also comes with updated versions of Ela and Elide and expands Ela documentation.


What's new in this release:

http://elalang.net/docs/Article.aspx?p=whatsnew.htm


Download:

https://ela.codeplex.com/releases/view/620592

Tikhonov Alexey

unread,
Mar 30, 2016, 11:48:23 PM3/30/16
to ela...@googlegroups.com
Hi!

Is this code correct?
//////////////////////////////
open io
open file
open string
 
writeText "ABC" "out.txt"
//////////////////////////////
 
IDE displays a message "A name 'writeText is not defined in a module or externally.'"
 
Alexey
 
21.03.2016, 20:28, "vorov2" <ba...@voronkov.name>:
--

---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
 
 
-- 
Best regards!
 
Alexey Tikhonov
 

Василий Воронков

unread,
Mar 31, 2016, 3:14:20 AM3/31/16
to ela...@googlegroups.com
Module file is an unsafe module and it is located in unsafe folder. So you should reference it like so:

open unsafe.file

Tikhonov Alexey

unread,
Mar 31, 2016, 4:25:24 AM3/31/16
to ela...@googlegroups.com
It works! But I don't understand while the code:
 
////////////////////
 
writeLines ["123","abc","def"] "D:\\temp\\out.txt" 
 
///////////////////
 
produces a file with only one line: "123"?
 
Alexey
 
31.03.2016, 13:14, "Василий Воронков" <ba...@voronkov.name>:
Module file is an unsafe module and it is located in unsafe folder. So you should reference it like so:

open unsafe.file

 

--

---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ba...@voronkov.name

unread,
Mar 31, 2016, 5:05:31 AM3/31/16
to ela...@googlegroups.com

Because there is an error in the library function J

 

You can manually change it to be as follows:

 

writeLines xs fl = io.truncateFile fl `seq` write (force xs)

  where f = force fl

        write (x::xs) = io.writeLine x f `seq` write xs

        write [] = ()

 

I will include a fix in the next release.

 

Anyway module “file” is a rather old unsafe module and at the moment you would probably prefer to use IO monad instead.

For example, you can  implement a “writeLines” function with the same behavior like so:

 

open monad io

 

//Function is written using do-notation with io monad

writeLines xs fn = do

    fh <- writeFile fn OpenCreateMode

    writeLines xs fh

    closeFile fh

    where

       writeLines [] _ = return ()

       writeLines (x::xs) fh = do

            writeStr (x ++ "\r\n") fh

            writeLines xs fh

 

//Usage

writeLines ["123", "abc", "defg"] "c:\\test\\output.txt"

 

Tikhonov Alexey

unread,
Mar 31, 2016, 5:28:20 AM3/31/16
to ela...@googlegroups.com
The fix works )
 
Let's continue:
//////////////////////////
 
xs = readLines id "D:\\temp\\input.txt"
 
//////////////////////////
Casues the error in module file.ela: " Invalid type. Expected: '?', got: 'Fun'. "
 
Can I fix it?
 
Alexey
 
--

---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ba...@voronkov.name

unread,
Mar 31, 2016, 6:18:34 AM3/31/16
to ela...@googlegroups.com

Again this is an error. This module haven’t been used for quite a while hence the load of bugs in it.

 

You can change this function to be as follows:

 

readLines !fl =

  let fh = io.openFile fl "OpenMode" "ReadAccess" in

  let str = io.readLines fh in

  io.closeFile fh `seq` str

 

It won’t work as a map though, and will return lines as a string, not as a list.

This will be also included in the next release.

Tikhonov Alexey

unread,
Mar 31, 2016, 6:25:52 AM3/31/16
to ela...@googlegroups.com
Thanks!
 

Tikhonov Alexey

unread,
May 30, 2016, 12:22:02 AM5/30/16
to ela...@googlegroups.com
Hello!

I found that function "div" is not implemented for big integer. Code
///
div 10i 3i
///
raises exception. Is there any alternative function or it is missed by error?
 
Alexey
 
21.03.2016, 20:28, "vorov2" <ba...@voronkov.name>:

Ela Platform 2016.3 is an iterative release that focuses on Ela standard library. The major change is an addition of a "measure" module that

 

--

---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ba...@voronkov.name

unread,
May 30, 2016, 9:06:37 AM5/30/16
to ela...@googlegroups.com

Yes, this is a bug in integer module. I’ll take a look at it.

 

From: ela...@googlegroups.com [mailto:ela...@googlegroups.com] On Behalf Of Tikhonov Alexey
Sent: Monday, May 30, 2016 7:22 AM
To: ela...@googlegroups.com
Subject: Re: Ela Platform 2016.3 is released

 

Hello!

ba...@voronkov.name

unread,
May 30, 2016, 9:10:08 AM5/30/16
to ela...@googlegroups.com

A fix is in repo, in module integer. To be included in the next version.

 

From: ela...@googlegroups.com [mailto:ela...@googlegroups.com] On Behalf Of Tikhonov Alexey
Sent: Monday, May 30, 2016 7:22 AM
To: ela...@googlegroups.com
Subject: Re: Ela Platform 2016.3 is released

 

Hello!

Tikhonov Alexey

unread,
Jun 2, 2016, 7:56:29 AM6/2/16
to ela...@googlegroups.com
Hello!
 
I created several source files (see the attachement) and wrote a test code to test a couple of functions:
//////////
let base = 10

    a = multByScalar base 1 [1,1] //Try to comment
    b = mult 10 [1] [1,1]
 in b

//////////

It produces result:

[1,1,1]

 
When I comment the second line like here:
//////////
let base = 10

    //a = multByScalar base 1 [1,1] //Try to comment
    b = mult 10 [1] [1,1]
 in b

//////////

I get another result:

[1,1]

Could you look at this?
Reproducing steps:
1. Extract the files from the attached archive to ela-platform\lib\
2. Open bignumSeriesMultiplication.ela in Elide
3. Execute and check the output
4. Comment the 21st line
5. Execute and check the output again
 
Alexey
 
21.03.2016, 20:28, "vorov2" <ba...@voronkov.name>:

Ela Platform 2016.3 is an iterative release that focuses on Ela standard library. The major change is an addition of a "measure" module that

 

--

---
You received this message because you are subscribed to the Google Groups "elalang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elalang+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
SampleCode.zip

ba...@voronkov.name

unread,
Jun 2, 2016, 10:38:42 AM6/2/16
to ela...@googlegroups.com

It’s not an impure behavior, but looks like some kind of a shadowing issue.  Multiplication references Summation which defines functions of the same name. Somehow a different implementation is chosen depending on the comment. I believe everything would work correctly if you declare these functions as qualified  (e.g. sum # qualified)?

 

I will look deeper into this.

Reply all
Reply to author
Forward
0 new messages