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
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?
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
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
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
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
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
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)?
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.
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)
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
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 `==`
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
Thanks, useful info. Although, I don't mind the colors. It's the forced
bolding that looks so bad... :(
>
>
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
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
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
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
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
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
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
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
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
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:
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
>
> 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
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
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
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
https://github.com/JuliaLang/julia/blob/3c354b4a391307d84915445bdd6fb464371f30fc/doc/at_macro_reasons
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
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
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...)
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
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,
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
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
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
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)
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
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,
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
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
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.
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
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
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
>
>
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
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,
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
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
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
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
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
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> 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
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
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
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.
>
>
> 3. Any other methods I should implement for my operator?
>
>
http://docs.julialang.org/en/release-0.4/manual/interfaces/#abstract-arrays
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",
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
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.
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
>
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
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
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
>
>
You could use WriteVTK.jl and render the point cloud in Paraview.
68 matches
Mail list logo