[julia-users] macro aliases? Can macro have the same assignment like temp = f::Function?

2014-12-31 Thread
I know there are type aliases and function assignment.

I find that a macro call is like Expr(:macrocall, symbol(@time),.)

And we can embed a macro inside a macro, but it looks really uncomfortable 
to me.

Thanks.


[julia-users] Re: Declaring variables in julia

2014-12-31 Thread
http://docs.julialang.org/en/release-0.3/manual/integers-and-floating-point-numbers/
 

This might be really useful, and I find that Julia's manual is really easy 
to understand.

在 2014年12月31日星期三UTC+8下午8时57分25秒,sadhanapriya...@vit.ac.in写道:

 hi


 Please let me know how to declare float, double, long int, unsigned long 
 and unsigned char to some variable in julia( Please mention syntax)
   


 Thanks



Re: [julia-users] Can I throw an error in c code just like Rcpp's stop() in Julia

2014-12-30 Thread
Thanks! jl_error() is what I want here.

This might help:

 http://docs.julialang.org/en/release-0.3/manual/embedding/#throwing-julia-exceptions

 On Wed, Dec 24, 2014 at 10:41 PM, 良无 out...@gmail.com javascript: 
 wrote:

 In C or C++ code, I have a function:

 void funcname(...){
...
assert(0);
...
 }

  if I run `ccall((:funcname, libpath), Void, (...), ...)` in Julia , it 
  will  terminate the Julia process.

 How can I replace assert() with other function to throw an error in Julia?


  ccall((:funcname, libpath), Void, (...), ...)

 ERROR: 

 I am sorry that I can not make it clear, and I just come to Julia from 
 the R world.  

 Thanks.  ;-) 

 I'm afraid I still don't get it. What do you want to do?


 On Dec 24, 2014, at 8:15 PM, 良无 out...@gmail.com wrote:

 If you want to release an R package to CRAN, R Core will force you to 
 check this by R CMD check:

 - Compiled code should never terminate the R process within which it is 
 running. Thus C/C++ calls to assert/abort/exit, Fortran calls to STOP and 
 so on must be avoided. Nor may R code call q().


 Le mercredi 24 décembre 2014 à 08:36 -0800, 良无 a écrit : 
  In my origin C++ code, I use assert(), but if I want to use this code 
  in Julia, maybe I need to replace it with other functions. In R, I 
 can 
  use Rcpp::stop(). Is there any easy way to do it in Julia with C or C 
  ++ code. 
 IIUC, you want to raise a Julia exception from C code, right? 

  And it seems that Julia does not have R CMD check like stuff yet. It 
  does not check this kind of issue. 
 You mean, running a test suite? See 
 http://docs.julialang.org/en/latest/stdlib/test/ 

 and how most packages do this, for example 
 https://github.com/JuliaStats/StatsBase.jl/tree/master/test 


 Regards 




[julia-users] Can I throw an error in c code just like Rcpp's stop() in Julia

2014-12-24 Thread


In my origin C++ code, I use assert(), but if I want to use this code in 
Julia, maybe I need to replace it with other functions. In R, I can use 
Rcpp::stop(). Is there any easy way to do it in Julia with C or C++ code.

And it seems that Julia does not have R CMD check like stuff yet. It does 
not check this kind of issue.

Thanks.


Re: [julia-users] Can I throw an error in c code just like Rcpp's stop() in Julia

2014-12-24 Thread
If you want to release an R package to CRAN, R Core will force you to check 
this by R CMD check:

- Compiled code should never terminate the R process within which it is 
running. Thus C/C++ calls to assert/abort/exit, Fortran calls to STOP and 
so on must be avoided. Nor may R code call q().


Le mercredi 24 décembre 2014 à 08:36 -0800, 良无 a écrit : 
  In my origin C++ code, I use assert(), but if I want to use this code 
  in Julia, maybe I need to replace it with other functions. In R, I can 
  use Rcpp::stop(). Is there any easy way to do it in Julia with C or C 
  ++ code. 
 IIUC, you want to raise a Julia exception from C code, right? 

  And it seems that Julia does not have R CMD check like stuff yet. It 
  does not check this kind of issue. 
 You mean, running a test suite? See 
 http://docs.julialang.org/en/latest/stdlib/test/ 

 and how most packages do this, for example 
 https://github.com/JuliaStats/StatsBase.jl/tree/master/test 


 Regards 



Re: [julia-users] Can I throw an error in c code just like Rcpp's stop() in Julia

2014-12-24 Thread
In C or C++ code, I have a function:

void funcname(...){
   ...
   assert(0);
   ...
}

 if I run `ccall((:funcname, libpath), Void, (...), ...)` in Julia , it 
 will  terminate the Julia process.

How can I replace assert() with other function to throw an error in Julia?


 ccall((:funcname, libpath), Void, (...), ...)

ERROR: 

I am sorry that I can not make it clear, and I just come to Julia from the 
R world.  

Thanks.  ;-) 

I'm afraid I still don't get it. What do you want to do?


 On Dec 24, 2014, at 8:15 PM, 良无 out...@gmail.com javascript: wrote:

 If you want to release an R package to CRAN, R Core will force you to 
 check this by R CMD check:

 - Compiled code should never terminate the R process within which it is 
 running. Thus C/C++ calls to assert/abort/exit, Fortran calls to STOP and 
 so on must be avoided. Nor may R code call q().


 Le mercredi 24 décembre 2014 à 08:36 -0800, 良无 a écrit : 
  In my origin C++ code, I use assert(), but if I want to use this code 
  in Julia, maybe I need to replace it with other functions. In R, I can 
  use Rcpp::stop(). Is there any easy way to do it in Julia with C or C 
  ++ code. 
 IIUC, you want to raise a Julia exception from C code, right? 

  And it seems that Julia does not have R CMD check like stuff yet. It 
  does not check this kind of issue. 
 You mean, running a test suite? See 
 http://docs.julialang.org/en/latest/stdlib/test/ 

 and how most packages do this, for example 
 https://github.com/JuliaStats/StatsBase.jl/tree/master/test 


 Regards