НА: Ela Platform 2013.1

16 views
Skip to first unread message

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

unread,
Mar 28, 2013, 7:12:27 AM3/28/13
to ela...@googlegroups.com
You mean integer division? There is a div function in standard library, in module number. You can take a look at this module and its docs. This module defines an Integral class that has both div and quot functions. So your code sample should be:

1 `div` 2

От: Tikhonov Alexey
Отправлено: ‎28.‎03.‎2013 14:58
Кому: ela...@googlegroups.com
Тема: Re: Ela Platform 2013.1

Hi!
 
I wonder whether it is possible to define the operator "/" in the standard library so that it returns Int for integer arguments ? Now 1/2 == 0.5f.
 
13.03.2013, 15:17, "Vasily Voronkov" <ba...@voronkov.name>:

Alexey,

An (:) is a function from index (numeric) to a value.

I guess you are looking for a function getField which would do a job in this case. You can find a description of this function in prelude documentation.

 

To answer your second question – Ela parser is not currently exposed to Ela code (you can make it available by yourself if you wish).

 

From: ela...@googlegroups.com [mailto:ela...@googlegroups.com] On Behalf Of Tikhonov Alexey
Sent: Wednesday, March 13, 2013 11:34 AM
To: ela...@googlegroups.com
Subject: Re: Ela Platform 2013.1

 

Ok, I looked through and see that I can answer my questions on myself. Of course the indexer takes only numeric arguments and io functions are defined in the corresponding module io.ela.

 

13.03.2013, 13:21, "Tikhonov Alexey" <a.le...@ya.ru>:

Hi, Vasily!

 

Documentation claimed that one may declare a record with field name that is not a valid Ela identifier and then use indexer operator to access the element. Does it mean that the following example should work:

 

let r = {"String"=0}

 in r:"String"

 

Actually it doesn't but may be I didn't get an idea what the indexer operator is. One more question Is there any inner mechanism implemented to read from / write to external files in Ela? For example to parse a file.

 

14.02.2013, 02:04, "vorov2" <ba...@voronkov.name>:

Ela Platform 2013.1 includes a new version of Ela (0.12.1) and a new version of standard library that provide a support for monadic programming in Ela including Haskell style "do" notation.
 
An overview of this release is available here:
http://elalang.net/docs/Article.aspx?p=whatsnew.htm
 
Download here:

http://elalang.googlecode.com/files/ela-platform-2013.1.zip

 

--
 
---
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/groups/opt_out.
 
 

 

--
 
---
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/groups/opt_out.
 
 

--
 
---
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/groups/opt_out.
 
 

 

--
 
---
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/groups/opt_out.
 
 

--
 
---
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/groups/opt_out.
 
 

vorov2

unread,
Mar 28, 2013, 7:19:05 AM3/28/13
to ela...@googlegroups.com
And "\" symbol unfortunately cannot be used as an operator symbol in Ela, because "\" is syntax (so called lambda operator, e.g. \x ->y).
You can find reserved operator symbols and keywords in Ela documentation: http://elalang.net/docs/Article.aspx?p=operatorpriority.htm

To unsubscribe from this group and stop receiving emails from it, send an email to elalang+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
 
---
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+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
 
---
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+unsubscribe@googlegroups.com.


For more options, visit https://groups.google.com/groups/opt_out.
 
 

 

--
 
---
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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
 
---
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+unsubscribe@googlegroups.com.

Tikhonov Alexey

unread,
Mar 29, 2013, 12:54:02 AM3/29/13
to ela...@googlegroups.com
 I tried to use test module but tests like "test_foo {eq} = [0] `eq` [1]" made Elide crush.
 
28.03.2013, 18:12, "Василий Воронков" <ba...@voronkov.name>:
You mean integer division? There is a div function in standard library, in module number. You can take a look at this module and its docs. This module defines an Integral class that has both div and quot functions. So your code sample should be:

1 `div` 2

От: Tikhonov Alexey
Отправлено: 28.03.2013 14:58

Vasily Voronkov

unread,
Mar 29, 2013, 8:13:08 AM3/29/13
to ela...@googlegroups.com

Alexey,

Actually this is a bug in string.format function (which is used internally by ‘test’ module).

For now you can apply a patch to ‘test’ module by replacing an existing assert function with the following definition (changes are highlighted in bold):

 

assert # private

assert =

  {

      eq  = op' "eq"  (==),

      neq = op' "neq" (<>),

      gt  = op' "gt"  (>),

      lt  = op' "lt"  (<),

      gte = op' "gte" (>=),

      lte = op' "lte" (<=),

      eqt = op' "eqt" (==) true,

      eqf = op' "eqf" (==) false

  }

  where op' m op x y

          | op x y = None

          | else   = Some (format ": Assert failed: {0} for {1} and {2}" m (show x) (show y))

 

I will include a fix with the next release.

vorov2

unread,
Mar 29, 2013, 5:49:43 PM3/29/13
to ela...@googlegroups.com
A small update:
This behavior was caused by a "stack overflow" in a library function (which is partially written in C#). A fix is in SVN, would be included in the next release.

Reply all
Reply to author
Forward
0 new messages