# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=1058

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 1059

---

## [Package test failing due to bounds checking enabled](https://discourse.julialang.org/t/package-test-failing-due-to-bounds-checking-enabled/2747)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 13\
**Last updated:** [March 19, 2017, 3:16pm UTC](https://discourse.julialang.org/t/package-test-failing-due-to-bounds-checking-enabled/2747 "2017-03-19T15:16:39Z")

</div>

I have a package failing tests (with julia 0.6 and nightly on Travis and AppVeyor) due to fact that Pkg.test runs julia with --check-bounds=yes flag. If I manually run the test from the command line with --check-bounds=…

---

## [Does in-progress documentation exist for 0.6?](https://discourse.julialang.org/t/does-in-progress-documentation-exist-for-0-6/2753)

<div class="topic-metadata">

**Author:** [@asampal](https://discourse.julialang.org/u/asampal)\
**Replies:** 4\
**Last updated:** [March 19, 2017, 2:43pm UTC](https://discourse.julialang.org/t/does-in-progress-documentation-exist-for-0-6/2753 "2017-03-19T14:43:02Z")

</div>

This is the latest I’ve found, but it doesn’t look like it’s being updated continuously.

---

## [Tuples of Ints as type parameters v0.5/0.6](https://discourse.julialang.org/t/tuples-of-ints-as-type-parameters-v0-5-0-6/2751)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 3\
**Last updated:** [March 19, 2017, 1:42pm UTC](https://discourse.julialang.org/t/tuples-of-ints-as-type-parameters-v0-5-0-6/2751 "2017-03-19T13:42:58Z")

</div>

Hi, I have a situation where I want to have a few tuples as type parameters. In v0.5 I used to have # works in v0.5 immutable foo{a, b, N, T} foo{N, T}(a\_::NTuple{N, T}, b\_::NTuple{N, T}) = new() end foo(a, b) = fo…

---

## [Unboxing in iteration](https://discourse.julialang.org/t/unboxing-in-iteration/2746)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 5\
**Last updated:** [March 18, 2017, 11:24pm UTC](https://discourse.julialang.org/t/unboxing-in-iteration/2746 "2017-03-18T23:24:27Z")

</div>

I am optimizing the following simple function: """ Calculate \`\`∑ₖ cₖ fₖ, k=1,...,n\`\` where \`\`fₖ₊₁ = α fₖ + β fₖ₋₁\`\` and the first two elements are given. Uses the reverse Clenshaw algorithm, stability is assumed. """ fu…

---

## [Update problems behind a corporate proxy with user and pass](https://discourse.julialang.org/t/update-problems-behind-a-corporate-proxy-with-user-and-pass/2560)

<div class="topic-metadata">

**Author:** [@Michael\_Hecht](https://discourse.julialang.org/u/Michael_Hecht)\
**Replies:** 2\
**Last updated:** [March 18, 2017, 11:33pm UTC](https://discourse.julialang.org/t/update-problems-behind-a-corporate-proxy-with-user-and-pass/2560 "2017-03-18T23:33:36Z")

</div>

Hello, I know this question was asked a hundred times in the web, but I did’nt find any solution. So I ask again for my special situation: I istalled a fresh Julia 0.5.1 64-bit on my windows 7 computer. There is no pro…

---

## [JuliaPro - packages error](https://discourse.julialang.org/t/juliapro-packages-error/2493)

<div class="topic-metadata">

**Author:** [@ogreyesp](https://discourse.julialang.org/u/ogreyesp)\
**Replies:** 8\
**Last updated:** [March 18, 2017, 3:28pm UTC](https://discourse.julialang.org/t/juliapro-packages-error/2493 "2017-03-18T15:28:38Z")

</div>

Hello, I’m new in Julia world. I like very much Julia, but I actually feel that I spend more time solving errors (not mines) than learning Julia. I have using JuliaPro for linux. I have downloaded JuliaPro, I have inst…

---

## [Matching delimiters in a string with regular expressions](https://discourse.julialang.org/t/matching-delimiters-in-a-string-with-regular-expressions/2736)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 0\
**Last updated:** [March 17, 2017, 5:39pm UTC](https://discourse.julialang.org/t/matching-delimiters-in-a-string-with-regular-expressions/2736 "2017-03-17T17:39:57Z")

</div>

I am working on converting IJulia notebooks to markua source files. Like markdown cells in a IJulia notebook, markua uses a superset of Markdown but not always with the same convention. In Jupyter markdown LaTeX expres…

---

## [min(NaN, 1.0) should return NaN](https://discourse.julialang.org/t/min-nan-1-0-should-return-nan/2741)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [March 17, 2017, 9:05pm UTC](https://discourse.julialang.org/t/min-nan-1-0-should-return-nan/2741 "2017-03-17T21:05:38Z")

</div>

Currently min(NaN, 1.0) returns 1.0. I think this is very unsafe. Is there a reason for this? I feel strongly that min(NaN, 1.0) should return NaN instead. The same applies to max and related functions, of course.

---

## [Weird constructor issue in 0.5 (resolved)](https://discourse.julialang.org/t/weird-constructor-issue-in-0-5-resolved/2740)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 0\
**Last updated:** [March 17, 2017, 7:11pm UTC](https://discourse.julialang.org/t/weird-constructor-issue-in-0-5-resolved/2740 "2017-03-17T19:11:49Z")

</div>

resolved - there was some orphaned code later on in the module.

---

## ["applicable method may be too new" error](https://discourse.julialang.org/t/applicable-method-may-be-too-new-error/2733)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 2\
**Last updated:** [March 17, 2017, 6:27pm UTC](https://discourse.julialang.org/t/applicable-method-may-be-too-new-error/2733 "2017-03-17T18:27:42Z")

</div>

I am trying to write a generated function which creates a function from within the generated body (to then pass to broadcast). In 0.5 this used to be fine, but in 0.6 you get the error that the “generated function body i…

---

## [Improving ccall speed for many calls](https://discourse.julialang.org/t/improving-ccall-speed-for-many-calls/2594)

<div class="topic-metadata">

**Author:** [@jmgnve](https://discourse.julialang.org/u/jmgnve)\
**Replies:** 12\
**Last updated:** [March 17, 2017, 4:41pm UTC](https://discourse.julialang.org/t/improving-ccall-speed-for-many-calls/2594 "2017-03-17T16:41:13Z")

</div>

Hi! I am calling a shared library (a model written in Fortran) using ccall. I need to call the model many thousand times. The code is quite fast, but I am wondering if there is a way to speed it up since the current set…

---

## [Is there a way to get the expression object for a function?](https://discourse.julialang.org/t/is-there-a-way-to-get-the-expression-object-for-a-function/2660)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 4\
**Last updated:** [March 17, 2017, 11:29am UTC](https://discourse.julialang.org/t/is-there-a-way-to-get-the-expression-object-for-a-function/2660 "2017-03-17T11:29:58Z")

</div>

Essentially, I’m writing some custom broadcast(op, args...) method and I want to do some fancy logic based on what function op is. Is there a way to turn op back into it’s expression object? Something like, f(x) = x^2 g…

---

## [AbstractStrings, Strings, and their Arrays](https://discourse.julialang.org/t/abstractstrings-strings-and-their-arrays/2724)

<div class="topic-metadata">

**Author:** [@msravi](https://discourse.julialang.org/u/msravi)\
**Replies:** 7\
**Last updated:** [March 17, 2017, 9:43am UTC](https://discourse.julialang.org/t/abstractstrings-strings-and-their-arrays/2724 "2017-03-17T09:43:25Z")

</div>

Hi, I know from reading the Julia documentation (and experimenting), that although String \<: AbstractString is true, Array{String} \<: Array{AbstractString} is false. So if I have a function that needs to accept an array…

---

## [Punctuation/syntax style guide](https://discourse.julialang.org/t/punctuation-syntax-style-guide/2718)

<div class="topic-metadata">

**Author:** [@ZacLN](https://discourse.julialang.org/u/ZacLN)\
**Replies:** 1\
**Last updated:** [March 17, 2017, 1:31am UTC](https://discourse.julialang.org/t/punctuation-syntax-style-guide/2718 "2017-03-17T01:31:54Z")

</div>

I’m currently working on a new parser package that will provide code analysis as it runs, part of which will be formatting hints. My hunting hasn’t found anything concrete so I’m looking for a bit of feedback on what are…

---

## [Help with coding up some matrix / broadcast function](https://discourse.julialang.org/t/help-with-coding-up-some-matrix-broadcast-function/2700)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 4\
**Last updated:** [March 16, 2017, 11:57pm UTC](https://discourse.julialang.org/t/help-with-coding-up-some-matrix-broadcast-function/2700 "2017-03-16T23:57:48Z")

</div>

Say I’ve coded up a type called Field, and defined broadcast over these objects so that I can multiply them, i.e. f1 = Field() f2 = Field() f1 .\* f2 .\* f1 # this works correctly Now I would also like to be able to wor…

---

## [Backend or Zlib problem with PyPlot / Matplotlib](https://discourse.julialang.org/t/backend-or-zlib-problem-with-pyplot-matplotlib/2685)

<div class="topic-metadata">

**Author:** [@danielc](https://discourse.julialang.org/u/danielc)\
**Replies:** 2\
**Last updated:** [March 16, 2017, 6:41pm UTC](https://discourse.julialang.org/t/backend-or-zlib-problem-with-pyplot-matplotlib/2685 "2017-03-16T18:41:22Z")

</div>

Hello everyone, I have a new workstation and I’m starting to setup Julia and packages. I installed Julia 0.5.1 but I’m having trouble with PyPlot. After a seemingly successful installation, I get an error about backends…

---

## [Is there way to get the list of typealias?](https://discourse.julialang.org/t/is-there-way-to-get-the-list-of-typealias/2693)

<div class="topic-metadata">

**Author:** [@YongHee-Kim](https://discourse.julialang.org/u/YongHee-Kim)\
**Replies:** 2\
**Last updated:** [March 16, 2017, 1:22pm UTC](https://discourse.julialang.org/t/is-there-way-to-get-the-list-of-typealias/2693 "2017-03-16T13:22:07Z")

</div>

For example If I struct type like this type Foo end typealias Bar Foo typealias Something Foo I want to know if there is way to get the list of typealias for Foo ( Bar, Something) Thanks!

---

## [Julia doesn't catch undefined variables at compile time?](https://discourse.julialang.org/t/julia-doesnt-catch-undefined-variables-at-compile-time/2616)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 23\
**Last updated:** [March 16, 2017, 12:53pm UTC](https://discourse.julialang.org/t/julia-doesnt-catch-undefined-variables-at-compile-time/2616 "2017-03-16T12:53:31Z")

</div>

function foo() x = 1 if x \< 1 println("less than 1") println(bar) else println("greater than or equal to 1") end end foo() the result is greater than or equal to 1 unless of co…

---

## [Incorrect ambiguity?](https://discourse.julialang.org/t/incorrect-ambiguity/2690)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 3\
**Last updated:** [March 16, 2017, 9:32am UTC](https://discourse.julialang.org/t/incorrect-ambiguity/2690 "2017-03-16T09:32:02Z")

</div>

I’m trying to understand why the following gives an ambiguity error both on 0.5 and 0.6: foo{T\<:Number}(::Bool, ::T) = 1 foo{S\<:Symbol}(::Union{S,Real}, ::Union{S,Real}) = 1 foo(true,4.) #ambiguity error here While it…

---

## [Nesting @testset; good idea, or not?](https://discourse.julialang.org/t/nesting-testset-good-idea-or-not/2164)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 3\
**Last updated:** [March 16, 2017, 6:35am UTC](https://discourse.julialang.org/t/nesting-testset-good-idea-or-not/2164 "2017-03-16T06:35:49Z")

</div>

I see two common patterns when it comes to testing larger packages. Coarse Style runtests.jl (Coarse Style) (this is often done with a loop over filenames but I’ll write it here in full) using Base.Test @testset "compA…

---

## [Killing a script causes a segmentation fault](https://discourse.julialang.org/t/killing-a-script-causes-a-segmentation-fault/2688)

<div class="topic-metadata">

**Author:** [@pfack](https://discourse.julialang.org/u/pfack)\
**Replies:** 1\
**Last updated:** [March 16, 2017, 5:49am UTC](https://discourse.julialang.org/t/killing-a-script-causes-a-segmentation-fault/2688 "2017-03-16T05:49:00Z")

</div>

When I run a script from bash like this $ julia hello.jl where hello.jl is just println("hello") and I try to kill it like any other program with Ctrl+c, it hangs for quite some time and finally comes back with Segm…

---

## [Tk core GUI library](https://discourse.julialang.org/t/tk-core-gui-library/2681)

<div class="topic-metadata">

**Author:** [@WiseOwl](https://discourse.julialang.org/u/WiseOwl)\
**Replies:** 1\
**Last updated:** [March 15, 2017, 4:32pm UTC](https://discourse.julialang.org/t/tk-core-gui-library/2681 "2017-03-15T16:32:17Z")

</div>

As we all know, CPython uses Tk as its native GUI library, it is included in the standard distributions. So why not do that to Julia? Applying the same idea.

---

## [Catering for non-coders](https://discourse.julialang.org/t/catering-for-non-coders/2674)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [March 15, 2017, 4:10pm UTC](https://discourse.julialang.org/t/catering-for-non-coders/2674 "2017-03-15T16:10:30Z")

</div>

There are 3 levels of skill: everyone that doesn’t know how to download, run, and edit code scientists that write research code they want to share but don’t know how to write webapps web developers that know how to bui…

---

## [Type instability - two examples: yes/no?](https://discourse.julialang.org/t/type-instability-two-examples-yes-no/2680)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 4\
**Last updated:** [March 15, 2017, 3:34pm UTC](https://discourse.julialang.org/t/type-instability-two-examples-yes-no/2680 "2017-03-15T15:34:24Z")

</div>

Which of these functions is type-unstable? If unstable: What are the performance implications? What’s the output in @code\_warntype that would indicate instability? (For the record: I know how to parameterize them; I’m…

---

## [Best practices for structuring larger projects](https://discourse.julialang.org/t/best-practices-for-structuring-larger-projects/2652)

<div class="topic-metadata">

**Author:** [@little-big-h](https://discourse.julialang.org/u/little-big-h)\
**Replies:** 10\
**Last updated:** [March 15, 2017, 3:01pm UTC](https://discourse.julialang.org/t/best-practices-for-structuring-larger-projects/2652 "2017-03-15T15:01:33Z")

</div>

I have a project that is becoming unwieldy in size and I’d like to break it up into modules. It doesn’t yet have parts that could be factored out as packages but I don’t want to rule out that it is heading that way. It h…

---

## [Precision of Float64 in Array](https://discourse.julialang.org/t/precision-of-float64-in-array/2663)

<div class="topic-metadata">

**Author:** [@Maxime\_Coorevits](https://discourse.julialang.org/u/Maxime_Coorevits)\
**Replies:** 6\
**Last updated:** [March 15, 2017, 8:52am UTC](https://discourse.julialang.org/t/precision-of-float64-in-array/2663 "2017-03-15T08:52:25Z")

</div>

Always in the study of my wrapper for ACME.jl, I need to convert 1d and 2d array of float64 from julia (libjulia/c-api) to armadillo C++ (arma::vec / arma::mat). In julia console, when I dump the array I need I get : j…

---

## [Generic functions sourced from multiple modules?](https://discourse.julialang.org/t/generic-functions-sourced-from-multiple-modules/2626)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 5\
**Last updated:** [March 15, 2017, 5:04am UTC](https://discourse.julialang.org/t/generic-functions-sourced-from-multiple-modules/2626 "2017-03-15T05:04:17Z")

</div>

module A type type1 foo(a::type1) end module B type type2 foo(a::type2) end if you do that and then try using A using B foo(arg) WARNING: both B and A export “foo”; uses of it in module Main must be qualified …

---

## [Metaprogramming design patterns](https://discourse.julialang.org/t/metaprogramming-design-patterns/2658)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 7\
**Last updated:** [March 14, 2017, 10:29pm UTC](https://discourse.julialang.org/t/metaprogramming-design-patterns/2658 "2017-03-14T22:29:39Z")

</div>

Feeling in a refactoring mood I decided to bravely tackle some performance bottlenecks that were present in Genie’s codebase. I decided to go for the low hanging fruits and squash The Evil eval. A quick search revealed …

---

## [Macro that uses ccall in julia-0.6.0](https://discourse.julialang.org/t/macro-that-uses-ccall-in-julia-0-6-0/2639)

<div class="topic-metadata">

**Author:** [@joaquimg](https://discourse.julialang.org/u/joaquimg)\
**Replies:** 5\
**Last updated:** [March 14, 2017, 9:36pm UTC](https://discourse.julialang.org/t/macro-that-uses-ccall-in-julia-0-6-0/2639 "2017-03-14T21:36:14Z")

</div>

I have the following macro: macro xprs\_ccall(func, args...) f = "XPRS$(func)" args = map(esc,args) is\_unix() && return quote ccall(($f,xprs), $(args...)) end is\_windows() && return quote …

---

## [Docstrings in macros](https://discourse.julialang.org/t/docstrings-in-macros/2659)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [March 14, 2017, 10:53am UTC](https://discourse.julialang.org/t/docstrings-in-macros/2659 "2017-03-14T10:53:57Z")

</div>

What’s the right way of defining docstrings in macros? Should I just use @doc? MWE: macro define\_singleton(docstring, typename, constant = Symbol(uppercase(string(typename)))) quote @doc $docstring immutable…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=1057)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=1059)
