Re: Postiats and C errors with array

2018-08-07 Thread 'Yannick Duchêne' via ats-lang-users
Le mardi 7 août 2018 21:40:16 UTC+2, gmhwxi a écrit : > > >>Python surprisingly does not have direct support for arrays, > > Python is not famous for being effcient :) > I know, at least 40x worse than the equivalent in any imperative language. I’m using it rather for its terse syntax (and

Re: Postiats and C errors with array

2018-08-07 Thread Hongwei Xi
>>Python surprisingly does not have direct support for arrays, Python is not famous for being effcient :) On Tue, Aug 7, 2018 at 3:20 PM, 'Yannick Duchêne' via ats-lang-users < ats-lang-users@googlegroups.com> wrote: > > > Le mardi 7 août 2018 19:39:54 UTC+2, gmhwxi a écrit : >> >> >>

Re: Postiats and C errors with array

2018-08-07 Thread Hongwei Xi
>>multiple dimension array types is not supported, We will support mutiple dimension arrays in ATS3. Such arrays are a necessity for many machine learning algorithms. On Tue, Aug 7, 2018 at 1:36 PM, Hongwei Xi wrote: > > >>I wonder why `#include "share/atspre_staload.hats"` of the basics which

Re: Postiats and C errors with array

2018-08-07 Thread Hongwei Xi
>>I wonder why `#include "share/atspre_staload.hats"` of the basics which are always loaded by default, because "share/atspre_staload.hats" seems often required. If you use ATS to generate, say, JavaScript, then you need a different header. On Tue, Aug 7, 2018 at 4:00 AM, 'Yannick Duchêne' via

Re: Postiats and C errors with array

2018-08-07 Thread 'Yannick Duchêne' via ats-lang-users
Le mardi 7 août 2018 10:04:58 UTC+2, Yannick Duchêne a écrit : > > […] It was not my matter, but may be for arrays with multiple dimension, > using abstract types and external implementation may be an option, but I > have never tried it. > Or rather interpret one-dimension array as the

Re: Postiats and C errors with array

2018-08-07 Thread 'Yannick Duchêne' via ats-lang-users
Le mardi 7 août 2018 10:00:51 UTC+2, Yannick Duchêne a écrit : > > […] > By the way, I wonder why `#include "share/atspre_staload.hats"` of the > basics which are always loaded by default, because > "share/atspre_staload.hats" seems often required. > Typo, sorry. I wanted to say “I wonder

Re: Postiats and C errors with array

2018-08-07 Thread 'Yannick Duchêne' via ats-lang-users
Le mardi 7 août 2018 04:18:01 UTC+2, gmhwxi a écrit : > > > @[int][3] is the type for a flat int array of size 3. > > Unfortunately, it is not fully supported at this point > (it can only be assigned to a var). Please use @(int, int, int) > instead. > Indeed, this works if there are only

Re: Postiats and C errors with array

2018-08-07 Thread 'Yannick Duchêne' via ats-lang-users
Le mardi 7 août 2018 03:37:55 UTC+2, Julian Fondren a écrit : > > Incidentally, this works: > > #include "share/atspre_staload.hats" > > typedef row = @(int, int, int) > val row1: row = (1, 2, 3) > val row2: row = (4, 5, 6) > var a = @[row](row1, row2) > val a12 = a[1].2 > > implement main0() =

Re: Postiats and C errors with array

2018-08-06 Thread Artyom Shalkhakov
вт, 7 авг. 2018 г. в 8:18, Hongwei Xi : > > @[int][3] is the type for a flat int array of size 3. > > Unfortunately, it is not fully supported at this point > (it can only be assigned to a var). Please use @(int, int, int) > instead. > > Are you planning to support this in ATS3? I guess another

Re: Postiats and C errors with array

2018-08-06 Thread Hongwei Xi
@[int][3] is the type for a flat int array of size 3. Unfortunately, it is not fully supported at this point (it can only be assigned to a var). Please use @(int, int, int) instead. On Mon, Aug 6, 2018 at 7:51 PM, 'Yannick Duchêne' via ats-lang-users < ats-lang-users@googlegroups.com> wrote: >

Re: Postiats and C errors with array

2018-08-06 Thread Julian Fondren
Incidentally, this works: #include "share/atspre_staload.hats" typedef row = @(int, int, int) val row1: row = (1, 2, 3) val row2: row = (4, 5, 6) var a = @[row](row1, row2) val a12 = a[1].2 implement main0() = println!(a12) On Monday, August 6, 2018 at 6:51:51 PM UTC-5, Yannick Duchêne wrote: