Re: [julia-users] Re: are macros hygienic?

2016-04-20 Thread Didier Verna
Yichao Yu wrote: >>> julia> macro finish() >>> t = 5 >>>end >> Your macro is also simply returning a `5` btw. Sorry, I meant :(t = 5). > Just to be clear, the behavior you observer is correct and expected. > Non-escaped variables used in macro is not

Re: [julia-users] Re: Ambiguous method definitions

2016-04-20 Thread Michael Borregaard
There are many cases where it is convenient to be able to give 0 kwargs. Is it not better to test for isempty(a) when the behavior is undefined for 0 arguments?

Re: [julia-users] Options for constructing a 3D surface from a point cloud

2016-04-20 Thread Chris
I've attached a sample dataset. It's a set of 500 x,y,z points. I still haven't been able to make much headway on this, so if someone could take the time to show me what's possible, I'd be very appreciative. On Monday, February 22, 2016 at 3:55:14 PM UTC-5, Chris wrote: > > I will work on

Re: [julia-users] Re: Ambiguous method definitions

2016-04-20 Thread Milan Bouchet-Valat
Le mercredi 20 avril 2016 à 08:50 -0700, Robert Gates a écrit : > I wonder if this should be an issue in julia itself. Perhaps it would > be good to require at least one argument? There has been some discussion about syntax to specify a minimum and maximum number of arguments. But nothing has been

Re: [julia-users] Re: are macros hygienic?

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 4:15 PM, Didier Verna wrote: > Yichao Yu wrote: > julia> macro finish() t = 5 end > >>> Your macro is also simply returning a `5` btw. > > Sorry, I meant :(t = 5). > > >> Just to be clear, the

Re: [julia-users] Re: are macros hygienic?

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 2:54 PM, Yichao Yu wrote: > On Wed, Apr 20, 2016 at 2:33 PM, Didier Verna wrote: >> I wrote: >> >>> Could someone explain what's hygienic about Julia's macros? Because I >>> cannot figure out an example by myself... >> >> OK, I

[julia-users] Re: Stuck with using and LOAD_PATH

2016-04-20 Thread Gregory Salvan
Thanks for replies (sorry I was not notified) The matter was for running tests often (BDD) and Pkg doesn't seem to be the solution. Finally I resolved it but still don't understand what was the matter. :) I've defined all modules in package.jl with exports and include then use "using

[julia-users] Re: Starting Julia with Julia -p 2 provides 1 worker

2016-04-20 Thread 'Greg Plowman' via julia-users
Sorry, I can't really help you with command line julia -p 2 But what happens when you call addprocs() from REPL? Also, what is the value of CPU_CORES (typed at REPL)?

Re: [julia-users] In these two ways to "create functions", which one is a better way?

2016-04-20 Thread David P. Sanders
If this is your actual use case, then I suggest checking out the Polynomials.jl package. In particular, there is a more efficient algorithm (Horner's algorithm) that you can use to actually evaluate such a function.

[julia-users] Rounding to zero from positive or negative numbers results in positive or negative zero.

2016-04-20 Thread David P. Sanders
You can avoid the problem using round(Int, x) Which returns the result as an integer. Integers do not have this situation (difference between +0.0 and -0.0)

[julia-users] Re: Warning on operations mixing BigFloat and Float64

2016-04-20 Thread Paweł Biernat
Thanks! I will try that. I might be wrong, but looking at the code of mpfr.jl I can find some functions that mix BigFloat and Float64 that don't rely on a convert, instead they just pass the arguments directly to the mpfr library (this

Re: [julia-users] Re: Rounding to zero from positive or negative numbers results in positive or negative zero.

2016-04-20 Thread Milan Bouchet-Valat
Le mardi 19 avril 2016 à 22:10 -0700, Jeffrey Sarnoff a écrit : > Hi, > > You have discovered that IEEE standard floating point numbers have > two distinct zeros: 0.0 and -0.0.  They compare `==` even though they > are not `===`.  If you want to consider +0.0 and -0.0 to be the same, > use `==`

Re: [julia-users] Re: Add packages as root?

2016-04-20 Thread Maurice Diamantini
Thank you very much, I'll do that. But I hope there will be a better way to do that before the 1.0 Julia version! -- Maurice Le mardi 19 avril 2016 18:04:09 UTC+2, Yichao Yu a écrit : > > On Tue, Apr 19, 2016 at 11:22 AM, Maurice Diamantini > wrote: > > > > Since two

[julia-users] Re: Change bold text in REPL to normal

2016-04-20 Thread cormullion
Thanks, useful info. Although, I don't mind the colors. It's the forced bolding that looks so bad... :( > >

[julia-users] Re: macros design

2016-04-20 Thread Didier Verna
I wrote: > What's the rationale behind this particular way of invoking macros > (the @ character) ? And why a single macro concept for two different > things (with or without arguments) ? Also, I'm wondering about the use of RETURN in all the one-liner macro examples from the

[julia-users] Re: methods ambiguity

2016-04-20 Thread Tamas Papp
On Monday, April 18, 2016 at 9:38:40 PM UTC+2, Steven G. Johnson wrote: > > > > On Monday, April 18, 2016 at 10:38:28 AM UTC-4, Didier Verna wrote: >> >> >> Julia warns you when there's an ambiguity in method specificity, and >> picks one "arbitrarily" (according to the manual). I guess

[julia-users] Julia Package Ecosystem Pulse Last updated 2016-03-17?

2016-04-20 Thread Andreas Lobinger
Hello colleagues, i learned this is triggered manually and not regularly, however looking at the webpage updates of 7 or 14 days are mentioned. Wishing a happy day, Andreas

Re: [julia-users] Re: macros design

2016-04-20 Thread Milan Bouchet-Valat
Le mercredi 20 avril 2016 à 15:34 +0100, Didier Verna a écrit : > Matt Bauman wrote: > > > > > It's nice for both humans (it's obvious that there could be some > > non-standard evaluation semantics or other such funniness) >   Maybe for /some/ humans ;-), but I don't like

Re: [julia-users] Re: Ambiguous method definitions

2016-04-20 Thread Tom Breloff
Yes I would say this is dangerous. Assuming there must be at least one input, the signature should probably be: f(firstval::T, rest::T...) = <...> though it certainly doesn't look as pretty. On Wed, Apr 20, 2016 at 10:54 AM, Robert Gates wrote: > Okay, perfect, that

Re: [julia-users] Re: Rounding to zero from positive or negative numbers results in positive or negative zero.

2016-04-20 Thread Andrew Gibb
On Wednesday, 20 April 2016 15:18:06 UTC+1, Stefan Karpinski wrote: > > IEEE has not made the programming language designer's life easy here. > Perhaps it's a subtle attempt to incentivise more designers of mathematical programming languages into IEEE standards committees?! > > On Wed, Apr

Re: [julia-users] Re: macros design

2016-04-20 Thread Didier Verna
cormull...@mac.com wrote: > https://github.com/JuliaLang/julia/blob/3c354b4a391307d84915445bdd6fb464371f30fc/doc/at_macro_reasons > Nice, thanks :-) -- ELS'16 registration open! http://www.european-lisp-symposium.org Lisp, Jazz, Aïkido: http://www.didierverna.info

[julia-users] Re: Warning on operations mixing BigFloat and Float64

2016-04-20 Thread Daan Huybrechs
I was not aware of that, but it is good to know - thanks! By now we are actually mixing different precision on purpose here and there, using standard conversions, so our current test is to solve a number of problems to well below double precision accuracy. On Wednesday, April 20, 2016 at

[julia-users] Re: Ambiguous method definitions

2016-04-20 Thread Robert Gates
Okay, perfect, that answered my question! I thought that at least one of the vararg arguments is mandatory. A philosophical thought: isn't this use-case kind of dangerous when overloading Base functions in packages? In my case, MultiPoly and Lazy both overload Base.+ with a varargs function

Re: [julia-users] Re: modules (documentation)

2016-04-20 Thread Didier Verna
Kristoffer Carlsson wrote: > Does the following examples help? I get it now, I think. Import also loads a module from somewhere if it's not present in the environment. Thanks. -- ELS'16 registration open! http://www.european-lisp-symposium.org Lisp, Jazz, Aïkido:

Re: [julia-users] Re: macros design

2016-04-20 Thread Didier Verna
Isaiah Norton wrote: > Just to follow up on this a bit: we've continually reworked the > metaprogramming documentation because it can be an especially > difficult concept for people who don't have a compiler background or > Lisp experience. The most common sources of

Re: [julia-users] Re: macros design

2016-04-20 Thread Isaiah Norton
> > Yup, implicit return works for macros, too. The manual makes it explicit > to emphasize the function-like syntax transformation (as opposed to > CPP-like textual substitution). Just to follow up on this a bit: we've continually reworked the metaprogramming documentation because it can be an

Re: [julia-users] Re: macros design

2016-04-20 Thread Didier Verna
Milan Bouchet-Valat wrote: > OTOH, short-circuit operators are in limited number (&& and ||). > Packages authors cannot create new ones without the user knowing Do you mean it's possible to create new short-circuit operators ? > Yes. For example, DataFrames.jl and

Re: [julia-users] Re: macros design

2016-04-20 Thread Milan Bouchet-Valat
Le mercredi 20 avril 2016 à 16:22 +0100, Didier Verna a écrit : > Milan Bouchet-Valat wrote: > > > > > OTOH, short-circuit operators are in limited number (&& and ||). > > Packages authors cannot create new ones without the user knowing >   Do you mean it's possible to create

Re: [julia-users] Re: Ambiguous method definitions

2016-04-20 Thread Robert Gates
I wonder if this should be an issue in julia itself. Perhaps it would be good to require at least one argument? On Wednesday, April 20, 2016 at 5:00:39 PM UTC+2, Tom Breloff wrote: > > Yes I would say this is dangerous. Assuming there must be at least one > input, the signature should probably

[julia-users] Re: macros design

2016-04-20 Thread cormullion
https://github.com/JuliaLang/julia/blob/3c354b4a391307d84915445bdd6fb464371f30fc/doc/at_macro_reasons

[julia-users] Re: methods ambiguity

2016-04-20 Thread Cedric St-Jean
Julia has parametric types though. f{T}(x::Vector{T}, b::Int) = 1 f{T<:Real}(x::Vector{T}, b) = 2 f([1,2], 5) On Wednesday, April 20, 2016 at 7:43:08 AM UTC-4, Tamas Papp wrote: > > On Monday, April 18, 2016 at 9:38:40 PM UTC+2, Steven G. Johnson wrote: >> >> >> >> On Monday, April 18, 2016 at

Re: [julia-users] Re: Change bold text in REPL to normal

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 10:11 AM, wrote: > I see. To get normal weight, red, warn() text, this works for me: > > Base.text_colors[:rednormal] = "\033[0m\033[31m" > Base.eval(parse("default_color_warn = :rednormal")) Base.eval(:(default_color_warn = :rednormal)) at

Re: [julia-users] Ambiguous method definitions

2016-04-20 Thread Keno Fischer
Could you be more specific about your confusion? Both those methods match `f()` so there's an ambiguity. On Wed, Apr 20, 2016 at 10:30 AM, Robert Gates wrote: > I was wondering how this can happen: > > julia> type T1; end > > > julia> type T2; end > > > julia> f(a::T1...)

[julia-users] Re: an error with DataFrames on Ubuntu 16.04 64bits

2016-04-20 Thread Henri Girard
I compile version 5.0 without any problems on 16.04 and the repos ones are working fine. Le dimanche 17 avril 2016 14:15:35 UTC+2, K leo a écrit : > > Run my julia code for the first time after setting julia up on Ubuntu > 16.04, I got the following errors: > > INFO: Precompiling module

[julia-users] modules (documentation)

2016-04-20 Thread Didier Verna
There are a couple of things that I find obscure in the modules documentation. It says that import operates on a single name at a time, but there's a counter-example in the table right below this sentence: import MyModule which looks like it imports a module as a whole. On the other hand,

[julia-users] julia make julia-deps error: (I may have solved a case)

2016-04-20 Thread louis scott
I think I solved at least one case. It helps that I just did a fresh install of mint rosa xfce edition, so it looks more like a machine that hasn't done development. A dev machine would have the missing parts as a matter of course. The issue is that make does not get all dependencies. I was

[julia-users] Creating symbols

2016-04-20 Thread Didier Verna
Out of curiosity, why the symbol function? I mean, why not making this functionality part of the Symbol constructor? -- ELS'16 registration open! http://www.european-lisp-symposium.org Lisp, Jazz, Aïkido: http://www.didierverna.info

[julia-users] Re: modules (documentation)

2016-04-20 Thread Kristoffer Carlsson
Does the following examples help? julia> NearestNeighbors.KDTree ERROR: UndefVarError: NearestNeighbors not defined in eval(::Module, ::Any) at ./boot.jl:243 julia> import NearestNeighbors julia> NearestNeighbors.KDTree # Can use dot notation on the imported module

[julia-users] Re: macros design

2016-04-20 Thread Matt Bauman
On Wednesday, April 20, 2016 at 8:58:35 AM UTC-4, Didier Verna wrote: > > > What's the rationale behind this particular way of invoking macros > (the @ character) ? It's nice for both humans (it's obvious that there could be some non-standard evaluation semantics or other such funniness)

Re: [julia-users] Re: Rounding to zero from positive or negative numbers results in positive or negative zero.

2016-04-20 Thread Stefan Karpinski
IEEE has not made the programming language designer's life easy here. On Wed, Apr 20, 2016 at 5:51 AM, Milan Bouchet-Valat wrote: > Le mardi 19 avril 2016 à 22:10 -0700, Jeffrey Sarnoff a écrit : > > Hi, > > > > You have discovered that IEEE standard floating point numbers

[julia-users] Re: Change bold text in REPL to normal

2016-04-20 Thread lapeyre . math122a
I see. To get normal weight, red, warn() text, this works for me: Base.text_colors[:rednormal] = "\033[0m\033[31m" Base.eval(parse("default_color_warn = :rednormal")) text_colors is defined in base/client.jl On Wednesday, April 20, 2016 at 3:10:19 PM UTC+2, cormu...@mac.com wrote: > > Thanks,

[julia-users] Re: Mathematical Computing course in Julia

2016-04-20 Thread Henri Girard
Thank you very much... I am trying to start julia with jupyter notebook and your course is really helpfull Kind regards Henri Le vendredi 15 avril 2016 04:17:40 UTC+2, Sheehan Olver a écrit : > > > > I'm currently lecturing the course MATH3076/3976 Mathematical Computing at > U. Sydney in

Re: [julia-users] Creating symbols

2016-04-20 Thread Stefan Karpinski
It should be made part of the Symbol constructor. There used to be a technical limitation that only composite types could be called as constructors. As a result, there are still a fair number of lowercase functions that that should be merged into constructors like Symbol. On Wed, Apr 20, 2016 at

Re: [julia-users] How to change REPL mode on startup?

2016-04-20 Thread lapeyre . math122a
Yes, AFAIK it is not possible to modify the REPL in .juliarc.jl because it is executed before the REPL runs. A tedious workaround is to use .juliarc.jl to create a REPL and then exit() upon completion before the usual REPL is started. I hadn't thought about a PR, but I can take a look at it.

Re: [julia-users] julia make julia-deps error: (I may have solved a case)

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 5:46 AM, louis scott wrote: > I think I solved at least one case. > It helps that I just did a fresh install of mint rosa xfce edition, so it > looks more like a machine that hasn't done development. > A dev machine would have the missing parts as

[julia-users] Ambiguous method definitions

2016-04-20 Thread Robert Gates
I was wondering how this can happen: *julia> **type T1; end* *julia> **type T2; end* *julia> **f(a::T1...) = ()* *f (generic function with 1 method)* *julia> **f(a::T2...) = ()* WARNING: New definition f(Main.T2...) at none:1 is ambiguous with: f(Main.T1...) at none:1. To

Re: [julia-users] Re: Change bold text in REPL to normal

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 11:53 AM, wrote: > Good, this works. But, I don't think the preference for expressions over > strings is mentioned in the Metaprogramming section of the manual. I didn't know parsing was even part of it. It really shouldn't be. > > John > >

Re: [julia-users] Re: Change bold text in REPL to normal

2016-04-20 Thread lapeyre . math122a
Good, this works. But, I don't think the preference for expressions over strings is mentioned in the Metaprogramming section of the manual. John On Wednesday, April 20, 2016 at 4:19:18 PM UTC+2, Yichao Yu wrote: > > On Wed, Apr 20, 2016 at 10:11 AM, > wrote: > > I

Re: [julia-users] How to change REPL mode on startup?

2016-04-20 Thread lapeyre . math122a
You can try this branch https://github.com/jlapeyre/julia/tree/gjl/replhooks In .juliarc.jl, you can include code like this: if isdefined(Base, :atreplrun) Base.atreplrun( (repl)->repl.interface.modes[1].prompt = "newprompt>" ) end to install a hook. Call atreplrun repeatedly to push hooks,

Re: [julia-users] What is the situation

2016-04-20 Thread Yichao Yu
Hi, On Wed, Apr 20, 2016 at 1:15 PM, wrote: > Hi, JuMP > I am wondering if its possible to use JuMP, AML to call equation solvers > like Sundials. What is the situation? is it possible now? or is it on the > road-map? While this list is perfectly fine for general questions

[julia-users] Re: Starting Julia with Julia -p 2 provides 1 worker

2016-04-20 Thread Iacopo Poli
I downloaded version 0.4.5, again calling it with -p 2 returns 1 process and 1 worker... I really can't understand why Il giorno martedì 19 aprile 2016 17:37:05 UTC+2, Andre Bieler ha scritto: > > Huh.. I just tried julia -p 2 on version 0.4.5 and it actually starts with > 3 processes and 2

[julia-users] Re: OT: entering Unicode characters

2016-04-20 Thread Henri Girard
Wonderfull answer ! I am new to julia (ijulia) today's exactly... But I was wondering how to get symbols... You save me a good lot of time ! So I will enjoy longer my favorite "Saumur Champigny" ! lol Le mercredi 15 janvier 2014 17:26:57 UTC+1, Stefan Karpinski a écrit : > > Since Julia source

[julia-users] What is the situation

2016-04-20 Thread rafzalan
Hi, JuMP I am wondering if its possible to use JuMP, AML to call equation solvers like Sundials. What is the situation? is it possible now? or is it on the road-map? Thanks

Re: [julia-users] Re: are macros hygienic?

2016-04-20 Thread Didier Verna
Yichao Yu wrote: >> julia> macro finish() >> :(t) >>end >> julia> macroexpand(:(@finish())) >> :t >> >> as expected. BTW, this is not really "global", as the manual says. It >> really is "outer scope". > > This is a bug, (the one I linked). It should be

[julia-users] a'*b and svds for custom operators

2016-04-20 Thread Madeleine Udell
Hi, I'm trying to define my own custom operator type that will allow me to implement my own * and '* operations for use inside eigenvalue or singular value routines like eigs and svds. But I'm having trouble making this work. Here's a simple example reimplementing matrix multiplication, with

[julia-users] round(Int, typemin(Float64))

2016-04-20 Thread K leo
julia> round(Int, typemin(Float64)) ERROR: InexactError() in round at ./float.jl:181 Should this be handled this way? Or is it better to make round(Int, typemin(Float64)) to be typemin(Int)? Also, why is typemin(Float64) -Inf but typemin(Int) -9223372036854775808? Can typemin(Int) be made -Inf

Re: [julia-users] round(Int, typemin(Float64))

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 9:32 PM, K leo wrote: > julia> round(Int, typemin(Float64)) > ERROR: InexactError() > in round at ./float.jl:181 > > Should this be handled this way? Or is it better to make round(Int, > typemin(Float64)) to be typemin(Int)? That's not how it

[julia-users] Multi capable sorted/hash maps

2016-04-20 Thread fblscode
Hi all, I put together a multi capable sorted set based on a skip list and a complementary hash adapter. SkipMap is currently about as fast as DataStructures.SortedDict, has per key multi/unique- and separate insert/update semantics. HashMap is about ten times slower than a regular Dict, and

Re: [julia-users] Options for constructing a 3D surface from a point cloud

2016-04-20 Thread Chris
I am hoping for a solution I can use from Julia itself, but this is a good idea, thanks. On Wednesday, April 20, 2016 at 5:38:20 PM UTC-4, Kristoffer Carlsson wrote: > > You could use WriteVTK.jl and render the point cloud in Paraview.

[julia-users] Re: a'*b and svds for custom operators

2016-04-20 Thread 'Greg Plowman' via julia-users
> > > 3. Any other methods I should implement for my operator? > > http://docs.julialang.org/en/release-0.4/manual/interfaces/#abstract-arrays

[julia-users] Grant funding and Julia Computing?

2016-04-20 Thread Sheehan Olver
Has anyone included "Julia Computing" charges in a grant proposal? Is this something that should be encouraged? I'm thinking of including this in my next grant proposal, maybe for some specific goal. For example, I could include something along the lines of "ApproxFun v0.5 compatibility",

[julia-users] Re: a'*b and svds for custom operators

2016-04-20 Thread 'Greg Plowman' via julia-users
On Thursday, April 21, 2016 at 11:17:32 AM UTC+10, Madeleine Udell wrote: > > Hi, > > I'm trying to define my own custom operator type that will allow me to > implement my own * and '* operations for use inside eigenvalue or singular > value routines like eigs and svds. But I'm having trouble

Re: [julia-users] Re: are macros hygienic?

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 6:12 PM, Didier Verna wrote: > Yichao Yu wrote: > >>> julia> macro finish() >>> :(t) >>>end >>> julia> macroexpand(:(@finish())) >>> :t >>> >>> as expected. BTW, this is not really "global", as the manual says.

Re: [julia-users] In these two ways to "create functions", which one is a better way?

2016-04-20 Thread Po Choi
Thanks. I need to pass a set of orthogonal functions and coefficients into my routines. So I want to know the best practice in Julia to do this. On Wednesday, April 20, 2016 at 12:51:47 AM UTC-7, David P. Sanders wrote: > > If this is your actual use case, then I suggest checking out the >

[julia-users] Re: Starting Julia with Julia -p 2 provides 1 worker

2016-04-20 Thread Iacopo Poli
Calling *addprocs()* from REPL with for example *CPU_CORES* as argument returns 5 procs and 4 workers as expected, CPU_CORES returns 4 (physical cores are 2, but logical ones are 4). Also *rmprocs() *works fine, removing all procs but the first. Il giorno mercoledì 20 aprile 2016 23:07:57

Re: [julia-users] Creating symbols

2016-04-20 Thread Tomas Lycken
I am all for changing this, but in the specific case of symbol/Symbol this is going to be massively breaking, and even if the fix is pretty simple (applying s/symbol\(/Symbol\(/ probably fixes 99% of the code) the timing needs to be right. What other cases are there of such functions that

Re: [julia-users] Re: are macros hygienic?

2016-04-20 Thread Yichao Yu
On Wed, Apr 20, 2016 at 2:33 PM, Didier Verna wrote: > I wrote: > >> Could someone explain what's hygienic about Julia's macros? Because I >> cannot figure out an example by myself... > > OK, I think I get it: > > julia> macro finish() > t = 5 >end > >

Re: [julia-users] Options for constructing a 3D surface from a point cloud

2016-04-20 Thread Kristoffer Carlsson
You could use WriteVTK.jl and render the point cloud in Paraview.