is there some simple, compact way way to add an element or list to a list?

say i want a list to be [1,2] or [1,2,3] depending on flag.  is there an 
elegant one-liner that will do that?

i'm cleaning up some code and what should be a simple thing looks more 
important than it should just because of the number of lines it takes.

i thought [[1 2] flag ? [3] : []] would do it, but 

julia> [[1 2] false ? [3] : []]
ERROR: mismatch in dimension 
1                                                  
 in cat_t at 
abstractarray.jl:681                                               
 in hcat at 
abstractarray.jl:720                                                

thanks,
andrew

Reply via email to