Re: [julia-users] help piping julia script in shell

2015-01-14 Thread lobreaux . prg
Thank you for your help. I now have to make my script switch from file input to STDIN input if required. Le jeudi 15 janvier 2015 04:16:27 UTC+1, Isaiah a écrit : > > isaiah@titan:/tmp$ cat t3.jl > x = readline(STDIN) > println("input was: ", x) > isaiah@titan:/tmp$ echo "hello" | julia t3.jl

[julia-users] matrix shape subview of a large size vector with julia 0.3

2015-01-14 Thread steven Varga
Hello, As a beginner Julia user I have the outlined problem and a peer review request if there is any implications of the proposed technique. The problem: To have a matrix{T} shape continuous sub-view of a vector{T} store the following code, using pointer to array, seem to work: myView{T,

Re: [julia-users] macros using global variables problem

2015-01-14 Thread yi lu
I don't know why my previous version won't work,BUT ``` macro nb(f, args...) :($f($(arg...))) end ``` will get the right result. What's the difference between `quote .. end` and `:( .. )` then? :P On Thu, Jan 15, 2015 at 11:06 AM, Isaiah Norton wrote: > julia> macro nb(f,

Re: [julia-users] help piping julia script in shell

2015-01-14 Thread Isaiah Norton
isaiah@titan:/tmp$ cat t3.jl x = readline(STDIN) println("input was: ", x) isaiah@titan:/tmp$ echo "hello" | julia t3.jl input was: hello On Wed, Jan 14, 2015 at 5:19 AM, wrote: > Hi, > > I have written different scripts in julia for which the input is so far a > file provided as an argument. T

Re: [julia-users] macros using global variables problem

2015-01-14 Thread Isaiah Norton
julia> macro nb(f, args...) arg1 = map(x->:($(esc(x))), args) :($f($(arg1...))) end julia> @nb print arr [0.0,0.020107, ... If you haven't used it already, I would suggest to look at macroexpand to see the expression resulting from each macro (for example,

[julia-users] Re: Complex infinity

2015-01-14 Thread Ed Scheinerman
And here are additional "unfortunate" behaviors with complex arithmetic as currently implemented. First, dividing nonzero by zero should give an infinite result. It does for real, but not complex: julia> 1/0 Inf julia> 1/(0+0*im) # Should be some form of infinity NaN + NaN*im Second: Divi

[julia-users] Julia previous versions download

2015-01-14 Thread Georgiana Onicescu
I have installed the current version of Julia 0.3.5 and as far as I know the Rmath library is no longer available (also it gave me an error when I tried to install it). I have some previous programs that I have created using Julia 0.2.0 in which I use Rmath. Is there any archive where I can dow

Re: [julia-users] macros using global variables problem

2015-01-14 Thread yi lu
Well, I don't get it very clearly. I learnt that 'esc' changes variable names of a local variable in the macro. But I want to reference the global variable out of the macro. I have little idea of Lisp macros, so I think I still cannot handle this. Would you please add more details? Yi On Wed, Jan

[julia-users] Re: rfft: Lack of type annotations causes major allocation overhead

2015-01-14 Thread elextr
Your typeof() in f1 prints the run-time type of the array, the type of the actual array returned by rfft(), but the code is generated using the compile time type of the return from rfft(). But as Andreas shows, the compile time type is incorrectly Any. Using Any the compiler has to generate r

Re: [julia-users] readdir returns inconsistent types

2015-01-14 Thread elextr
On Thursday, January 15, 2015 at 3:02:13 AM UTC+10, Steven G. Johnson wrote: > > > > On Tuesday, January 13, 2015 at 10:38:23 PM UTC-5, ele...@gmail.com wrote: >> >> Probably right if the mutations for adding extensions etc are not >> conveniently available with Vector{uint8}. >> > > It would ce

Re: [julia-users] Strange Type Errors

2015-01-14 Thread Steven G. Johnson
On Wednesday, January 14, 2015 at 4:19:35 PM UTC-5, Milan Bouchet-Valat wrote: Yes, zeros() only accepts integers currently. Maybe this could be > changed to automatically do the conversion when possible. > See https://github.com/JuliaLang/julia/issues/1972

Re: [julia-users] Speed of Julia when a function is passed as an argument, and a different, but much faster coding.

2015-01-14 Thread Tobias Knopp
*julia> **type GGG end* *julia> **call(::Type{GGG}, d::Int) = d* *call (generic function with 858 methods)* *julia> **GGG(4)* *4* *julia> **GGG(2)* *2* Cheers Tobias Am Mittwoch, 14. Januar 2015 23:09:26 UTC+1 schrieb Petr Krysl: > > Hi Tobias, > > Is there an example of the use

[julia-users] Re: Help with using sublime iJulia

2015-01-14 Thread ccsv . 1056915
Also when I run similar code in python it would take 3 seconds. Am I doing something wrong?

Re: [julia-users] Speed of Julia when a function is passed as an argument, and a different, but much faster coding.

2015-01-14 Thread Petr Krysl
Hi Tobias, Is there an example of the use of this new syntax for 0.4? Thanks, Petr On Sunday, January 11, 2015 at 12:20:39 PM UTC-8, Tobias Knopp wrote: > > The call syntax is part of 0.4 > > Cheers > > Tobi > > Am Sonntag, 11. Januar 2015 19:35:06 UTC+1 schrieb Petr Krysl: >> >> On Sunday,

Re: [julia-users] Foro julia-user-es, para discutir acerca de Julia en español.

2015-01-14 Thread Ivan Ogasawara
Genial :) El 14/01/2015 17:59, "Ismael VC" escribió: > Foro julia-user-es, para discutir acerca de Julia en español: :D > > https://groups.google.com/forum/#!forum/julia-users-es >

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
> OK, got it. Keno was right: you're actually redefining the cdCanvas type > when calling include("../src/libcd_h.jl"). So you have both IUP.cdCanvas > and cdCanvas. > Shit, I should have been able to find this myself. Thanks a million. I hope to be able to pay back if I ever manage to ma

Re: [julia-users] Strange Type Errors

2015-01-14 Thread Milan Bouchet-Valat
Le mercredi 14 janvier 2015 à 13:00 -0800, jspark a écrit : > > > Hi, > > > > I am trying to port following simple Matlab code into Julia to get mu > > > M=500 > m_plus=M*0.2; > m_0=M*0.1; > m_minus=M*0.7; > > mu_plus=0.15+0.5*(1:m_plus)/m_plus; > mu_minus=-3*(1:m_minus

[julia-users] Strange Type Errors

2015-01-14 Thread jspark
Hi, I am trying to port following simple Matlab code into Julia to get *mu* M=500 m_plus=M*0.2; m_0=M*0.1; m_minus=M*0.7; mu_plus=0.15+0.5*(1:m_plus)/m_plus; mu_minus=-3*(1:m_minus)/m_minus; mu_0=zeros(1,m_0); *mu*=[mu_plus mu_0 mu_minus] However, with Julia, t

Re: [julia-users] The dark side of types

2015-01-14 Thread Milan Bouchet-Valat
Le mercredi 14 janvier 2015 à 11:59 -0800, J Luis a écrit : > > Just a shot in the dark, but if instead of this: > ctgc_l = tCTC_l(C_NULL) > ctgc_l.iup_canvas = t > cdActivate(ctgc_l.iup_canvas) > > you do this: > ctgc_l = tCTC_l(t) >

[julia-users] Re: Julia cannot compute factorial(21) while Octave can

2015-01-14 Thread ggggg
Is there a way to provide a suggestion with the error? It currently says this, *julia> **factorial(21)* *ERROR: OverflowError()* * in factorial_lookup at combinatorics.jl:27* * in factorial at combinatorics.jl:35* Maybe it would be more useful if it said *julia> **factorial(21)* *ERROR: Ov

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
> Just a shot in the dark, but if instead of this: > ctgc_l = tCTC_l(C_NULL) > ctgc_l.iup_canvas = t > cdActivate(ctgc_l.iup_canvas) > > you do this: > ctgc_l = tCTC_l(t) > cdActivate(ctgc_l.iup_canvas) > > does it make any difference? > unfortunately, no (and took care to comment line 1

[julia-users] Foro julia-user-es, para discutir acerca de Julia en español.

2015-01-14 Thread Ismael VC
Foro julia-user-es, para discutir acerca de Julia en español: :D https://groups.google.com/forum/#!forum/julia-users-es

Re: [julia-users] The dark side of types

2015-01-14 Thread Milan Bouchet-Valat
Le mercredi 14 janvier 2015 à 11:27 -0800, J Luis a écrit : > OK, I've uploaded the code to IUP repo. > What I mean in last message is that if I remove the type assignment in > line 19 of > > https://github.com/joa-quim/IUP.jl/blob/master/examples/cdtest_.jl > > than the line 133 does not error,

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
OK, I've uploaded the code to IUP repo. What I mean in last message is that if I remove the type assignment in line 19 of https://github.com/joa-quim/IUP.jl/blob/master/examples/cdtest_.jl than the line 133 does not error, otherwise it happens what I described. Sorry but don't know how to make a

[julia-users] Re: 1º reunión de Julians, México D.F.

2015-01-14 Thread Ismael VC
...también si piensan venir de visita este fin de semana! ;) ### Hello everyone! If you live in Mexico City, the metropolitan area or just plan to visit us this weekend, you are wellcome this saturday at *KMMX*! Details are in spanish, but you are interested, just ask! :D El miércoles, 14 de

[julia-users] Re: New method should respect previous syntax?

2015-01-14 Thread Matt Bauman
You can choose to defer those more complicated cases to Base: signif(x::Float64, digits::Integer) = println("Felipe's swanky customized signif") signif(args…) = Base.signif(args…) # Punt to the Base implementation for all other cases On Wednesday, January 14, 2015 at 1:24:34 PM UTC-5, Felipe J

[julia-users] 1º reunión de Julians, México D.F.

2015-01-14 Thread Ismael VC
Hola a todos! Si viven por el D.F. o la zona metropolitana los esperamos este sábado en *KMMX*! Detalles: http://www.meetup.com/julialang-mx Alla nos vemos! :D

Re: [julia-users] The dark side of types

2015-01-14 Thread Milan Bouchet-Valat
Le mercredi 14 janvier 2015 à 10:44 -0800, J Luis a écrit : > What I found is if, for simplification, I restrict the type to (that > is without type assignment) > > type tCTC_l > iup_canvas > end > > than it works. But if I change it to > > type tCTC_l > iup_canvas::Ptr{cdCanvas} > end >

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
What I found is if, for simplification, I restrict the type to (that is without type assignment) type tCTC_l iup_canvas end than it works. But if I change it to type tCTC_l iup_canvas::Ptr{cdCanvas} end it errors again. For curiosity I tried also type tCTC_l iup_canvas::Int64 end

[julia-users] Re: Julia cannot compute factorial(21) while Octave can

2015-01-14 Thread Viral Shah
I am guessing, that like Matlab, octave uses doubles to represent integers, and hence you can go a bit farther than with integers. That should be the same as factorial(21.0) in julia. Of course, you can also use BigInt and such, which has already been discussed here. -viral On Tuesday, January

[julia-users] Re: working with dense parallel matrices

2015-01-14 Thread Viral Shah
These capabilities are being actively developed. Beyond the parallel section of the Julia manual, also see: https://github.com/JuliaParallel/MPI.jl/ -viral On Saturday, January 10, 2015 at 1:29:11 AM UTC+5:30, Francis Poulin wrote: > > Hello, > > I am very new to Julia and trying to learn how

[julia-users] Re: New method should respect previous syntax?

2015-01-14 Thread Felipe Jiménez
Thank you, Steven. Your explanations are clear and helpful. But then I don't know how to obtain the behavior I want. A) I don't want to completely replace Base's signif because I still want access to Julia's methods. For instance, my method only works in base 10, so I don't want to lose Julia's

[julia-users] ANN: CUDArt and CUFFT

2015-01-14 Thread Tim Holy
Due to an oversight on my part, I never made official packages out of CUDArt and CUFFT. That has now been rectified. As you might guess from the names, these package are part of julia's growing collection of GPU-computing resources. https://github.com/JuliaGPU/CUDArt.jl https://github.com/Julia

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
Yes, an synthetic example would be nice, but I strongly suspect that if I was able to create one than it would because I had found the problem. quarta-feira, 14 de Janeiro de 2015 às 16:15:20 UTC, Milan Bouchet-Valat escreveu: > > Le mercredi 14 janvier 2015 à 07:42 -0800, J Luis a écrit : > >

Re: [julia-users] rfft: Lack of type annotations causes major allocation overhead

2015-01-14 Thread Andreas Noack
Done in https://github.com/JuliaLang/julia/issues/9772 2015-01-14 10:19 GMT-05:00 Andreas Noack : > There appears to be a problem with rfft. > > julia> @code_typed rfft(randn(10)) > > 1-element Array{Any,1}: > > :($(Expr(:lambda, Any[:X], > Any[Any[],Any[Any[:X,Array{Float64,1},0]],Any[]], :(beg

Re: [julia-users] readdir returns inconsistent types

2015-01-14 Thread Steven G. Johnson
On Tuesday, January 13, 2015 at 10:38:23 PM UTC-5, ele...@gmail.com wrote: > > Probably right if the mutations for adding extensions etc are not > conveniently available with Vector{uint8}. > It would certainly be possible to define these operations, e.g. concatenation of a string with a bytev

Re: [julia-users] The dark side of types

2015-01-14 Thread Milan Bouchet-Valat
Le mercredi 14 janvier 2015 à 07:42 -0800, J Luis a écrit : > Well, I can make the current (failing) code available in the IUP repo > but to run it implies installing the IUP lib, and IUP.jl which > probably no one tested in other than Windows. But the problem does not seem to involve IUP (or via a

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
Well, I can make the current (failing) code available in the IUP repo but to run it implies installing the IUP lib, and IUP.jl which probably no one tested in other than Windows. quarta-feira, 14 de Janeiro de 2015 às 15:30:20 UTC, Milan Bouchet-Valat escreveu: > > Le mercredi 14 janvier 2015 à

Re: [julia-users] macros using global variables problem

2015-01-14 Thread Isaiah Norton
You need to use 'esc' -- see the hygiene part of the metaprog section in the manual. On Jan 14, 2015 8:56 AM, "yi lu" wrote: > Hi, > > I am able to write a simple macro to drop brackets. > https://gist.github.com/eccstartup/36637d96355bd5ca8188 > > But there is some problem with this. > > You can

Re: [julia-users] The dark side of types

2015-01-14 Thread Milan Bouchet-Valat
Le mercredi 14 janvier 2015 à 06:54 -0800, J Luis a écrit : > I already fall in those two forms of troubles (double definition and > double inclusion of the file where the type is defined) so I'm aware > of it. As much as I can tell with grepping, that is not occurring > now. > Maybe a third (unkn

Re: [julia-users] rfft: Lack of type annotations causes major allocation overhead

2015-01-14 Thread Andreas Noack
There appears to be a problem with rfft. julia> @code_typed rfft(randn(10)) 1-element Array{Any,1}: :($(Expr(:lambda, Any[:X], Any[Any[],Any[Any[:X,Array{Float64,1},0]],Any[]], :(begin # fftw.jl, line 639: return rfft(X::Array{Float64,1},$(Expr(:new, UnitRange{Int64}, 1, :(((top(getfi

[julia-users] module PyPlot won't initialize on julia 0.3.5

2015-01-14 Thread Philip Loewen
I'm new to julia, trying to get PyPlot working. Eventually I hope to see graphics in iJulia, but the GUI is not needed to reproduce the problem detailed below. At the command line, saying "julia" reveals the header logo, including relevant version info: Version 0.3.5 (2015-01-08 22:33 UTC) Of

[julia-users] help piping julia script in shell

2015-01-14 Thread lobreaux . prg
Hi, I have written different scripts in julia for which the input is so far a file provided as an argument. The output is printed on stdout. I would like to be able to use them with files as input or to pipe them in unix shell so the output of a script is taken as input by the next script in th

[julia-users] Moving a point to constraint

2015-01-14 Thread tmjohari
Hi, I am very new to Julia Programming. Is there a package/easy way to project a point onto a constraint line/plane, or at least calculate the distance(maybe euclidean distance) between the point and constraint plane/line and move the point later on by adding the distance(later changed to vec

[julia-users] rfft: Lack of type annotations causes major allocation overhead

2015-01-14 Thread emilhedevang
Hi all, In the code below I define two functions, f1 and f2, that take a three-dimensional array of Float64, computes the real FFT (rfft) and loops once over the computed values of the rfft. In f1, a lot of time is spent in the simple for loop, and many, many bytes are allocated. In f2, very li

Re: [julia-users] Does TypeCheck specify which methods failed ?

2015-01-14 Thread Leah Hanson
Hi, Yes, the method signatures should print out between the call the checkreturntypes and the "The total number..." line. Currently, it often prints out a lot of unnecessary new lines, so you may need to scroll up. If you don't see that output at all, please file an issue on the TypeCheck.jl gith

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
I already fall in those two forms of troubles (double definition and double inclusion of the file where the type is defined) so I'm aware of it. As much as I can tell with grepping, that is not occurring now. Maybe a third (unknown to me) form of this type of issue? quarta-feira, 14 de Janeiro

Re: [julia-users] The dark side of types

2015-01-14 Thread Keno Fischer
Are you maybe accidentally defining cdCanvas twice or in two different modules? On Wed, Jan 14, 2015 at 3:40 PM, J Luis wrote: > BTW, if that matters, 'ctgc' is a global variable. > > quarta-feira, 14 de Janeiro de 2015 às 14:37:05 UTC, J Luis escreveu: > >> Hi, thanks for looking into this. >>

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
BTW, if that matters, 'ctgc' is a global variable. quarta-feira, 14 de Janeiro de 2015 às 14:37:05 UTC, J Luis escreveu: > > Hi, thanks for looking into this. > > If I make them show, as > > @show ctgc.iup_canvas > ctgc.iup_canvas = t > @show t > @show ctgc.iup_canvas > > it 'shows' > > ctgc.i

Re: [julia-users] should I use types

2015-01-14 Thread Erik Schnetter
On Jan 14, 2015, at 6:02 , Simon Danisch wrote: > > You could in addition use ImmutableArrays: > > immutable Packet{T} > ID::{T} > position::Vector3{T} > direction::Vector3{T} > energy::{T} > time::{T} > end > Which makes Packet a bitstype, with efficient

Re: [julia-users] The dark side of types

2015-01-14 Thread J Luis
Hi, thanks for looking into this. If I make them show, as @show ctgc.iup_canvas ctgc.iup_canvas = t @show t @show ctgc.iup_canvas it 'shows' ctgc.iup_canvas => Ptr{cdCanvas} @0x t => Ptr{cdCanvas} @0x22c6d6c0 ctgc.iup_canvas => Ptr{cdCanvas} @0x22c6d6c0 whic

[julia-users] macros using global variables problem

2015-01-14 Thread yi lu
Hi, I am able to write a simple macro to drop brackets. https://gist.github.com/eccstartup/36637d96355bd5ca8188 But there is some problem with this. You can see the @nobrace macro that drop brackets of functions. For example: ``` @nobrace map (x->x^2-1) 1:0.01:2 ``` get a list of Float numbers.

Re: [julia-users] The dark side of types

2015-01-14 Thread Milan Bouchet-Valat
Le mercredi 14 janvier 2015 à 05:32 -0800, J Luis a écrit : > Hi, > I have had quite some head-aches with types (converted from C structs) > but this one wins. > > I have this type (from IUP) > > > type tCTC > iup_canvas::Ptr{cdCanvas} > w::Cint > h::Cint > ... > > which I initializ

[julia-users] The dark side of types

2015-01-14 Thread J Luis
Hi, I have had quite some head-aches with types (converted from C structs) but this one wins. I have this type (from IUP) type tCTC iup_canvas::Ptr{cdCanvas} w::Cint h::Cint ... which I initialize as ctgc = tCTC( convert(Ptr{cdCanvas},0), int32(0), int32(0), ... a

Re: [julia-users] exemplar package for 0.4-style documentation

2015-01-14 Thread Tom Short
It just hasn't been implemented, yet. Lexicon complains with "type BasicREPL has no field interface". I'm guessing that a simpler approach could be used in Lexicon, or it could be implemented in ESS (unfortunately, no ESS developers really use Julia). On Wed, Jan 14, 2015 at 4:23 AM, Tamas Papp w

Re: [julia-users] How can I write a @map macro?

2015-01-14 Thread yi lu
Thanks Mike, this works. On Wed, Jan 14, 2015 at 5:40 PM, Mike Innes wrote: > I think that's because it's being parsed as > > @map (+1):10 11:20 > > If you're using operators on their own, it's a good idea to put them in > parens: > > @map (+) 1:10 11:20 > > On 14 January 2015 at 09:36, yi lu

Re: [julia-users] Size of Julia types

2015-01-14 Thread Jan Niklas Hasse
2015-01-14 11:43 GMT+01:00 Tim Holy : > If you can, use > > immutable B > x::A > end > > The "type" version contains a reference to an A, not the entire A structure > itself. The C analog of what you were doing would be > > struct B { > A* x; > }; > > which of course doesn't have the same s

[julia-users] Re: should I use types

2015-01-14 Thread Simon Danisch
You could in addition use ImmutableArrays: immutable Packet{T} ID::{T} position::Vector3{T} direction::Vector3{T} energy::{T} time::{T} end Which makes Packet a bitstype, with efficient memory layout. If you need to mutate these, there are actually ways, whe

Re: [julia-users] Size of Julia types

2015-01-14 Thread Tim Holy
If you can, use immutable B x::A end The "type" version contains a reference to an A, not the entire A structure itself. The C analog of what you were doing would be struct B { A* x; }; which of course doesn't have the same size as A. --Tim On Wednesday, January 14, 2015 02:22:19 AM

Re: [julia-users] exemplar package for 0.4-style documentation

2015-01-14 Thread Michael Hatherly
Just as a note regarding this new syntax for anyone reading: It’s still being experimented with in Docile/Lexicon, though so far I’ve found it much more enjoyable to use. Package load times aren’t affected nearly as much as with @doc since collection and parsing of docstrings only happens once

Re: [julia-users] Size of Julia types

2015-01-14 Thread Keno Fischer
Hi Jan, since mutable julia object require a type tag, they always require a pointer and cannot be structurally inlined. The assertion would hold if both types were declared `immutable`. On Wed, Jan 14, 2015 at 11:22 AM, Jan Niklas Hasse wrote: > Hi! > > I'm new to Julia and was wondering why >

[julia-users] Size of Julia types

2015-01-14 Thread Jan Niklas Hasse
Hi! I'm new to Julia and was wondering why type A x::Ptr{Void} y::Ptr{Void} end type B x::A end assert(sizeof(A) == sizeof(B)) doesn't work while the C version #include struct A { void* x; void* y; }; struct B { A x; }; int main() { assert(sizeof(A) == sizeof(B

[julia-users] Help with using sublime iJulia

2015-01-14 Thread ccsv . 1056915
So I am trying the sublime IDE again after failing to resolve problems in Juno. So far I got julia installed and working, but it is a bit slower on running code than LightTable. I am thinking about switching but I have two concerns 1. Plotting in Gadfly does not work 2. Plotting speed is slow.

Re: [julia-users] Re: Later methods definition replaces the previous one?

2015-01-14 Thread Mauro
There has been some talk about overloading `.` which could accommodate your suggestion. Have a look at https://github.com/JuliaLang/julia/issues/1974 On Tue, 2015-01-13 at 23:08, Ivan Ogasawara wrote: > Hi, I am newbie yet, but maybe julia could have an operator to wrap a > function call to spec

Re: [julia-users] How can I write a @map macro?

2015-01-14 Thread Mike Innes
I think that's because it's being parsed as @map (+1):10 11:20 If you're using operators on their own, it's a good idea to put them in parens: @map (+) 1:10 11:20 On 14 January 2015 at 09:36, yi lu wrote: > @map + 1:10 11:20 > > failed > :) > > On Wed, Jan 14, 2015 at 5:23 PM, Mike Innes > w

Re: [julia-users] How can I write a @map macro?

2015-01-14 Thread yi lu
@map + 1:10 11:20 failed :) On Wed, Jan 14, 2015 at 5:23 PM, Mike Innes wrote: > Using $(args...) should do the trick, I think. > > On 14 January 2015 at 09:20, yi lu wrote: > >> Hi, >> >> I want to write a macro which works as map function. >> >> It should work for these. >> >> ``` >> @map x-

Re: [julia-users] How can I write a @map macro?

2015-01-14 Thread Mike Innes
Using $(args...) should do the trick, I think. On 14 January 2015 at 09:20, yi lu wrote: > Hi, > > I want to write a macro which works as map function. > > It should work for these. > > ``` > @map x->x+1 1:10 > @map + 1:10 11:20 > ``` > > I know it is just copying the argument list in the macro

Re: [julia-users] exemplar package for 0.4-style documentation

2015-01-14 Thread Tamas Papp
On Tue, Jan 13 2015, Tom Short wrote: > If you want to try the Sims docs at the REPL, you'll need to checkout that > package and enter "using Sims, Sims.Lib, Lexicon". Then you can do > ?Resistor or ?"Capacitor. > > Note that the question mark doesn't work in ESS. Is that an intrinsic limitation

[julia-users] How can I write a @map macro?

2015-01-14 Thread yi lu
Hi, I want to write a macro which works as map function. It should work for these. ``` @map x->x+1 1:10 @map + 1:10 11:20 ``` I know it is just copying the argument list in the macro to the map function, but I get stuck. ``` macro map(f,args...) quote map($f, $args...) end end ``` won