Re: [Vala] Tokenize_and_fold bug?

2014-11-17 Thread Michele Dionisio
try to define your variable x with

[CCode (array_length = false, array_null_terminated = true)]


2014-11-17 5:15 GMT+01:00 Andy Lees andrewl...@gmail.com:

 Hi,

 Not sure if I'm doing this wrong, but if I do something like:

 public static int main(string [] argv) {
   string[] x;
   var a = 1,2, 345.tokenize_and_fold (en_GB, out x);
   stdout.printf(Len: %d\n, a.length);
   foreach (var s in a) {
 stdout.printf(tok: %s, s);
   }
   return 0;
 }

 I get a C compiler error:
 /home/andrewl/Vala/VTest1/prop.vala.c: In function ‘_vala_main’:
 /home/andrewl/Vala/VTest1/prop.vala.c:41:2: error: too many arguments to
 function ‘g_str_tokenize_and_fold’
   _tmp3_ = _tmp2_ = g_str_tokenize_and_fold (1,2, 345, en_GB, _tmp0_,
 _tmp1_);
   ^

 As does any variation of two arguments.  Fewer than 2 args results in a
 vala compiler error.

 Bug?
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Tokenize_and_fold bug?

2014-11-17 Thread Luca Bruno
On 17/11/2014 05:15, Andy Lees wrote:
 Hi,

 Not sure if I'm doing this wrong, but if I do something like:

 public static int main(string [] argv) {
   string[] x;
   var a = 1,2, 345.tokenize_and_fold (en_GB, out x);
   stdout.printf(Len: %d\n, a.length);
   foreach (var s in a) {
 stdout.printf(tok: %s, s);
   }
   return 0;
 }

 I get a C compiler error:
 /home/andrewl/Vala/VTest1/prop.vala.c: In function ‘_vala_main’:
 /home/andrewl/Vala/VTest1/prop.vala.c:41:2: error: too many arguments to
 function ‘g_str_tokenize_and_fold’
   _tmp3_ = _tmp2_ = g_str_tokenize_and_fold (1,2, 345, en_GB, _tmp0_,
 _tmp1_);
   ^

 As does any variation of two arguments.  Fewer than 2 args results in a
 vala compiler error.
The bindings for this function are broken. Can you please report a bug?
https://bugzilla.gnome.org/enter_bug.cgi?product=vala

Best regards,
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Tokenize_and_fold bug?

2014-11-17 Thread Andy Lees
Same result.  Submitted bug.

On Mon, Nov 17, 2014 at 7:31 PM, Michele Dionisio 
michele.dioni...@gmail.com wrote:

 try to define your variable x with

 [CCode (array_length = false, array_null_terminated = true)]


 2014-11-17 5:15 GMT+01:00 Andy Lees andrewl...@gmail.com:

 Hi,

 Not sure if I'm doing this wrong, but if I do something like:

 public static int main(string [] argv) {
   string[] x;
   var a = 1,2, 345.tokenize_and_fold (en_GB, out x);
   stdout.printf(Len: %d\n, a.length);
   foreach (var s in a) {
 stdout.printf(tok: %s, s);
   }
   return 0;
 }

 I get a C compiler error:
 /home/andrewl/Vala/VTest1/prop.vala.c: In function ‘_vala_main’:
 /home/andrewl/Vala/VTest1/prop.vala.c:41:2: error: too many arguments to
 function ‘g_str_tokenize_and_fold’
   _tmp3_ = _tmp2_ = g_str_tokenize_and_fold (1,2, 345, en_GB, _tmp0_,
 _tmp1_);
   ^

 As does any variation of two arguments.  Fewer than 2 args results in a
 vala compiler error.

 Bug?
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list



___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] VAPI bindings for external lib

2014-11-17 Thread Gonzalo Aguilar Delgado

Hello,

I'm modifiying babobab to support a ceph cluster. And want to do add 
several tools to position files on OSDs, show fragemntation of 
underlaying filesystems, etc. Maybe this will generate other tool, but 
for now just modifying.


The problem is that I cannot access directly to librados, libcephfs 
libraries from vala. Ehem, I can do it by just linking but figuring out 
what's the best way to do it.


I suppose that creating a binding is the best. I saw some tutorials but 
all require that library already uses GObject system that's not the case.


So, should I create a wrapping object lib, and then generate bindings 
from there?


Or should I do another way? I'm thinking about just adding dep and call 
it from vala like c. But don't know what's the best way to proceed.


Best regards,
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] VAPI bindings for external lib

2014-11-17 Thread Luca Bruno
On 17/11/2014 14:28, Gonzalo Aguilar Delgado wrote:
 Hello,

 I'm modifiying babobab to support a ceph cluster. And want to do add
 several tools to position files on OSDs, show fragemntation of
 underlaying filesystems, etc. Maybe this will generate other tool, but
 for now just modifying.

 The problem is that I cannot access directly to librados, libcephfs
 libraries from vala. Ehem, I can do it by just linking but figuring
 out what's the best way to do it.

 I suppose that creating a binding is the best. I saw some tutorials
 but all require that library already uses GObject system that's not
 the case.

 So, should I create a wrapping object lib, and then generate bindings
 from there?

 Or should I do another way? I'm thinking about just adding dep and
 call it from vala like c. But don't know what's the best way to proceed.

If those libs are C, just write the .vapi by hand. Use compact classes
and structs, unless they have reference-counted objects.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] VAPI bindings for external lib

2014-11-17 Thread Michael Catanzaro
On Mon, 2014-11-17 at 14:28 +0100, Gonzalo Aguilar Delgado wrote:
 Hello,
 
 I'm modifiying babobab to support a ceph cluster. And want to do add 
 several tools to position files on OSDs, show fragemntation of 
 underlaying filesystems, etc. Maybe this will generate other tool, but 
 for now just modifying.
 
 The problem is that I cannot access directly to librados, libcephfs 
 libraries from vala. Ehem, I can do it by just linking but figuring out 
 what's the best way to do it.
 
 I suppose that creating a binding is the best. I saw some tutorials but 
 all require that library already uses GObject system that's not the case.
 
 So, should I create a wrapping object lib, and then generate bindings 
 from there?
 
 Or should I do another way? I'm thinking about just adding dep and call 
 it from vala like c. But don't know what's the best way to proceed.
 
 Best regards

There's a lot of documentation on this here:
https://wiki.gnome.org/Projects/Vala/LegacyBindings


signature.asc
Description: This is a digitally signed message part
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] VAPI bindings for external lib

2014-11-17 Thread Gonzalo Aguilar Delgado

Hi,

perfect! Thank you for fast response.

Just one question. Is there any vapi repos to upload resulting vapi. It 
would be nice to have something like nexus for maven but in this case 
for vapis.


Best regards,


El 17/11/14 a las 14:41, Luca Bruno escribió:

On 17/11/2014 14:28, Gonzalo Aguilar Delgado wrote:

Hello,

I'm modifiying babobab to support a ceph cluster. And want to do add
several tools to position files on OSDs, show fragemntation of
underlaying filesystems, etc. Maybe this will generate other tool, but
for now just modifying.

The problem is that I cannot access directly to librados, libcephfs
libraries from vala. Ehem, I can do it by just linking but figuring
out what's the best way to do it.

I suppose that creating a binding is the best. I saw some tutorials
but all require that library already uses GObject system that's not
the case.

So, should I create a wrapping object lib, and then generate bindings
from there?

Or should I do another way? I'm thinking about just adding dep and
call it from vala like c. But don't know what's the best way to proceed.


If those libs are C, just write the .vapi by hand. Use compact classes
and structs, unless they have reference-counted objects.
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list



___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] VAPI bindings for external lib

2014-11-17 Thread Gonzalo Aguilar Delgado

Hi Michael,

I missed this one. Thank you.

El 17/11/14 a las 16:07, Michael Catanzaro escribió:

On Mon, 2014-11-17 at 14:28 +0100, Gonzalo Aguilar Delgado wrote:

Hello,

I'm modifiying babobab to support a ceph cluster. And want to do add
several tools to position files on OSDs, show fragemntation of
underlaying filesystems, etc. Maybe this will generate other tool, but
for now just modifying.

The problem is that I cannot access directly to librados, libcephfs
libraries from vala. Ehem, I can do it by just linking but figuring out
what's the best way to do it.

I suppose that creating a binding is the best. I saw some tutorials but
all require that library already uses GObject system that's not the case.

So, should I create a wrapping object lib, and then generate bindings
from there?

Or should I do another way? I'm thinking about just adding dep and call
it from vala like c. But don't know what's the best way to proceed.

Best regards

There's a lot of documentation on this here:
https://wiki.gnome.org/Projects/Vala/LegacyBindings


___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] VAPI bindings for external lib

2014-11-17 Thread Luca Bruno
On 17/11/2014 17:46, Gonzalo Aguilar Delgado wrote:
 Hi,

 perfect! Thank you for fast response.

 Just one question. Is there any vapi repos to upload resulting vapi.
 It would be nice to have something like nexus for maven but in this
 case for vapis.

This is the official unofficial list of extra vapis :)
https://github.com/nemequ/vala-extra-vapis . It's unofficial in the
sense that it's not maintained in the vala tree, it's official in the
sense that as Vala developers we suggest using it. Should be the perfect
place for sharing your vapi.

Best regards,
___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


[Vala] Adding unitary test support to Autovala

2014-11-17 Thread rastersoft

Hi all:

I'm working on adding unitary test support to autovala, but have some 
doubts that I want to comment here, to ensure that the implementation is 
right.


The first one is how to define each unitary test; my original idea was: 
one file, one test, so inside a folder called unitests will be as 
many .vala files as unitary tests (even in subfolders). But then I 
considered that, maybe, some tests are so big that needs several files, 
in which case the way to go would be one folder, one test, and all the 
.vala files inside should belong to the same test. Which one is the best 
approach?


The second one is if I should always compile the tests, or do it only if 
the user sets an specific flag when calling cmake (thus, people just 
downloading the source and compiling at home wouldn't need to compile 
everything).


Thanks.

--
Nos leemos
 RASTER(Linux user #228804)
ras...@rastersoft.com  http://www.rastersoft.com

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Adding unitary test support to Autovala

2014-11-17 Thread Craig
Not exactly sure what you mean, but a very common pattern is one unit test
file for each class (unit) you want to test. This has worked fine for me in
every language I've worked with.
On Nov 17, 2014 4:07 PM, rastersoft ras...@rastersoft.com wrote:

 Hi all:

 I'm working on adding unitary test support to autovala, but have some
 doubts that I want to comment here, to ensure that the implementation is
 right.

 The first one is how to define each unitary test; my original idea was:
 one file, one test, so inside a folder called unitests will be as many
 .vala files as unitary tests (even in subfolders). But then I considered
 that, maybe, some tests are so big that needs several files, in which case
 the way to go would be one folder, one test, and all the .vala files
 inside should belong to the same test. Which one is the best approach?

 The second one is if I should always compile the tests, or do it only if
 the user sets an specific flag when calling cmake (thus, people just
 downloading the source and compiling at home wouldn't need to compile
 everything).

 Thanks.

 --
 Nos leemos
  RASTER(Linux user #228804)
 ras...@rastersoft.com  http://www.rastersoft.com

 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Adding unitary test support to Autovala

2014-11-17 Thread Steven Oliver
I would suggest one test per file. That seems to be the most common use
case in my opinion.

I also don't see why you couldn't in theory do both. All files in the top
directory are one test per file. Anything in a sub directory is treated as
all files are compiled to a test.
On Mon, Nov 17, 2014 at 6:06 PM Craig webe...@gmail.com wrote:

 Not exactly sure what you mean, but a very common pattern is one unit test
 file for each class (unit) you want to test. This has worked fine for me in
 every language I've worked with.
 On Nov 17, 2014 4:07 PM, rastersoft ras...@rastersoft.com wrote:

  Hi all:
 
  I'm working on adding unitary test support to autovala, but have some
  doubts that I want to comment here, to ensure that the implementation is
  right.
 
  The first one is how to define each unitary test; my original idea was:
  one file, one test, so inside a folder called unitests will be as
 many
  .vala files as unitary tests (even in subfolders). But then I considered
  that, maybe, some tests are so big that needs several files, in which
 case
  the way to go would be one folder, one test, and all the .vala files
  inside should belong to the same test. Which one is the best approach?
 
  The second one is if I should always compile the tests, or do it only if
  the user sets an specific flag when calling cmake (thus, people just
  downloading the source and compiling at home wouldn't need to compile
  everything).
 
  Thanks.
 
  --
  Nos leemos
   RASTER(Linux user #228804)
  ras...@rastersoft.com  http://www.rastersoft.com
 
  ___
  vala-list mailing list
  vala-list@gnome.org
  https://mail.gnome.org/mailman/listinfo/vala-list
 
 ___
 vala-list mailing list
 vala-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/vala-list

___
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list