[julia-users] cannot resize array with shared data

2015-02-19 Thread andrew cooke
Hi, I'm trying to understand the bug report at https://github.com/andrewcooke/CRC.jl/issues/4 which has julia> using CRC julia> crc32c = crc(CRC_32_C) handler (generic function with 3 methods) julia> a = b"hello world"; julia> crc32c(a) 0xc99465aa julia> resize!(a, 5) ERROR: cannot resize ar

Re: [julia-users] cannot resize array with shared data

2015-02-21 Thread andrew cooke
on somewhere in the > docs. A more informative error might also be useful. Would you mind > opening up an issue (and/or if you're so motivated, a pull request)? > > Cheers, > >Kevin > > > > On Thu, Feb 19, 2015 at 2:39 AM, andrew cooke > wrote: > &g

[julia-users] Anything changng assembly?

2015-03-22 Thread andrew cooke
I'm aware of https://groups.google.com/forum/#!searchin/julia-users/calling$20assembly/julia-users/fJHZCAJkrgo/VV7ZskAjqzMJ - I'm wondering if anything has changed in the last few years? Is calling C still the best way to call inline assembly? I ask because for a general library, I am not su

Re: [julia-users] Anything changng assembly?

2015-03-22 Thread andrew cooke
; - third arg is the argument types > - then the actual arguments > > Hope that helps to get started. > > [1] Create a file at the base of the source tree called `Make.user` with > contents: > > LLVM_VER = 3.6.0 > > and then proceed with the standard build instruct

[julia-users] error compiling fill!: box: argument not of a primitive type

2015-05-14 Thread andrew cooke
Hi, I'm returning to Julia after a long break (a year?) and am trying to get some old code I had lying around compiling. When I try to run tests for https://github.com/andrewcooke/IntModN.jl (at 4bc2734b80a15108ff66fd61705681e9d50a94c1) I see the error: andrew@laptop:~/project/IntModN> julia

[julia-users] Re: error compiling fill!: box: argument not of a primitive type

2015-05-14 Thread andrew cooke
Well, this all works fine with 0.3, so I'm going to chalk this up to weirdness in git trunk 0.4 (the above was with git as of an hour or so before posting). Andrew

Re: [julia-users] error compiling fill!: box: argument not of a primitive type

2015-05-14 Thread andrew cooke
i started to file one, and then tried to check my results with the latest code, and now everything works. so i'm trying to triangulate what on earth the error was as far as i know all i did was change the type of an exception or two...

Re: [julia-users] error compiling fill!: box: argument not of a primitive type

2015-05-14 Thread andrew cooke
ah. no - https://github.com/JuliaLang/julia/issues/11270 also, https://github.com/JuliaLang/julia/issues/11271 On Thursday, 14 May 2015 16:29:09 UTC-3, andrew cooke wrote: > > i started to file one, and then tried to check my results with the latest > code, and now everything works

[julia-users] 0.3 prereleases should not be tagged.

2015-05-14 Thread andrew cooke
please can someone explain to me what the subject means, in the conversation here - https://github.com/JuliaLang/METADATA.jl/pull/2589 i understand waiting for travis - there was some warning i shouldn't have clicked through - but i have no idea what prerelease is referring to. thanks, i'd just

Re: [julia-users] 0.3 prereleases should not be tagged.

2015-05-14 Thread andrew cooke
fore* Julia 0.3, e.g. a 0.3 > prerelease. > > You should get rid of the minus sign, and all will be okay. > -E > > On Thu, May 14, 2015 at 4:11 PM, andrew cooke > wrote: > >> please can someone explain to me what the subject means, in the >> conversation he

[julia-users] llvmcall printf

2015-05-16 Thread andrew cooke
Does anyone have a working example that calls printf via llvmcall? I realise I'm uncomfortably inbetween llvmdev and julia-users, but I'm asking here first because I suspect my limitations are still more julia-related. In particular, julia> g() = Base.llvmcall(""" call i32 (i8*, ...

[julia-users] Re: how to create a command with an unquoted backslash in it?

2015-05-16 Thread andrew cooke
just playing around, it seems to me like julia is escaping with slashes. i don't have imagmagick installed, but with echo it woks as expected: julia> run(`echo \(`) ( julia> run(`echo \\(`) \( julia> ^D andrew@netbook:~> echo ( bash: syntax error near unexpected token `newline' andrew@netbook:

Re: [julia-users] llvmcall printf

2015-05-17 Thread andrew cooke
i can pin that down i think i can ask a sensible question on llvmdev... cheers, andrew On Saturday, 16 May 2015 22:01:25 UTC-3, Yichao Yu wrote: > > On Sat, May 16, 2015 at 5:01 PM, andrew cooke > wrote: > > > > Does anyone have a working example that calls printf via llvm

Re: [julia-users] llvmcall printf

2015-05-17 Thread andrew cooke
ons don't seem to be accepted, for >> example. > > > See > https://github.com/JuliaLang/julia/pull/8740 > > > On Sun, May 17, 2015 at 10:17 AM, andrew cooke > wrote: > >> thanks, but the reason i need lvmcall is because i want to call a >> spec

Re: [julia-users] llvmcall printf

2015-05-17 Thread andrew cooke
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150126/255137.html On Sunday, 17 May 2015 15:23:31 UTC-3, Isaiah wrote: > > What instruction are you trying to call? > > On Sun, May 17, 2015 at 11:21 AM, andrew cooke > wrote: > >> >> ah, than

Re: [julia-users] llvmcall printf

2015-05-17 Thread andrew cooke
-3, andrew cooke wrote: > > > > > http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150126/255137.html > > On Sunday, 17 May 2015 15:23:31 UTC-3, Isaiah wrote: >> >> What instruction are you trying to call? >> >> On Sun, May 17, 2015 at 11:21 AM,

[julia-users] supporting multiple julia releases ina single source file

2015-05-24 Thread andrew cooke
Julia 0.4 has changed the rand! api (in a good way - the generator is now explicit) and I am wondering whether I can support both in a single code base. What I'd really like, being old fashioned and simple, is something like cpp's macros that let me switch between two different sets of code:

[julia-users] Re: supporting multiple julia releases ina single source file

2015-05-24 Thread andrew cooke
you're right. i was worrying too much. this is all i need. thanks, andrew On Sunday, 24 May 2015 14:49:54 UTC-3, Scott Jones wrote: > > Here is an example: > if VERSION < v"0.4-" > typealias AbstractString String > endif > > > > On Sunday, M

Re: [julia-users] supporting multiple julia releases ina single source file

2015-05-24 Thread andrew cooke
this issue, which I think would do what you want: > https://github.com/JuliaLang/julia/issues/7449 > > On Sun, 2015-05-24 at 19:26, andrew cooke > > wrote: > > Julia 0.4 has changed the rand! api (in a good way - the generator is > now > > explicit) and I am wo

[julia-users] "size" of a Tuple type in 0.4

2015-05-24 Thread andrew cooke
Is there a simple way, in 0.4, given the type of a tuple, to know how many entries it has? When types of tuples were themselves tuples you could just use length, but that no longer works. (I don't have a desperately important use case, it's just the hacky way I wrote some tests in some code I

[julia-users] Re: fatal: 'XCB' does not appear to be a git repository, i tend to disagree...

2015-05-24 Thread andrew cooke
there's the file REQUIRE in ~/.julia/v if that is ok try Pkg.resolve() On Sunday, 24 May 2015 14:53:21 UTC-3, Andreas Lobinger wrote: > > Or too much information. > > On Sunday, May 24, 2015 at 10:43:29 AM UTC+2, Andreas Lobinger wrote: >> >> Hello colleagues, >> might be a glitch somewhere, a m

Re: [julia-users] "size" of a Tuple type in 0.4

2015-05-25 Thread andrew cooke
thanks! On Sunday, 24 May 2015 16:32:43 UTC-3, Yichao Yu wrote: > > On Sun, May 24, 2015 at 3:13 PM, andrew cooke > wrote: > > > > Is there a simple way, in 0.4, given the type of a tuple, to know how > many > > entries it has? > > > > When types

[julia-users] Pkg.create() error (git process)

2015-05-25 Thread andrew cooke
I am seeing this on two different computers, on trunk (below is 7 days old, but also on latest pull) and 0.3: _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "help()" for help.

[julia-users] Re: Pkg.create() error (git process)

2015-05-25 Thread andrew cooke
didn't have user.name set... andrew On Monday, 25 May 2015 18:55:36 UTC-3, andrew cooke wrote: > > > I am seeing this on two different computers, on trunk (below is 7 days > old, but also on latest pull) and 0.3: > > >_ _ _(_)_ | A fresh appro

Re: [julia-users] Cxx on Windows?

2015-05-25 Thread andrew cooke
if you run make again, do you get a more helpful error? if it's running multiple threads sometimes the logging is confused and erstarting (and immediately hitting the error) is helpful. On Monday, 25 May 2015 17:38:47 UTC-3, J Luis wrote: > > Hmm, I~m confused with this error. What failed? > >

[julia-users] How to import names that clash?

2015-05-25 Thread andrew cooke
Both Logging and Base export `info` and `warn`. I have absolutely no use for the Base methods, so want to use the ones provided by Logging, without prefixing every call with `Logging.` Reading through the docs, and also https://github.com/JuliaLang/julia/issues/4345, it's not clear how to do

[julia-users] Non top-level functions shadow global methods?

2015-05-27 Thread andrew cooke
I have a bad feeling I have asked this before, but can't find the thread, sorry. How do I make the following work as expected (ie print "integer") instead of giving an error? julia> foo(i::Integer) = print("integer") foo (generic function with 1 method) julia> foo(42) integer julia> function

Re: [julia-users] Non top-level functions shadow global methods?

2015-05-27 Thread andrew cooke
> julia> baz(4) > integer > > > On Wed, 2015-05-27 at 13:33, andrew cooke > > wrote: > > I have a bad feeling I have asked this before, but can't find the > thread, > > sorry. How do I make the following work as expected (ie print > "in

Re: [julia-users] Non top-level functions shadow global methods?

2015-05-27 Thread andrew cooke
: > > On Wed, May 27, 2015 at 9:17 AM, andrew cooke > wrote: > > > > I don't want to define a global method. I want this to be local to the > > scope where it's defined. > > ``` > julia> foo(::Integer) = print("integer") > foo (

[julia-users] Maybe, Nullable, etc

2015-05-29 Thread andrew cooke
I'm not sure if I'm confused, or if there's a problem here, and I don't know what any fix would be anyway, so apologies for the open-ended post but... I cannot find on "option" type in Julia that I can dispatch on, so that I have a method call different functions, depending on whether a value

[julia-users] Re: Maybe, Nullable, etc

2015-05-29 Thread andrew cooke
On Friday, 29 May 2015 10:16:40 UTC-3, andrew cooke wrote: > > > 1 - There is a way to dispatch on Nothing, and please someone explain it > to me > That should be "Nullable", sorry. > >

[julia-users] Re: Maybe, Nullable, etc

2015-05-29 Thread andrew cooke
Ahh! No, its possible: julia> foo(::Nullable{Union()}) = "empty" foo (generic function with 1 method) julia> foo(::Nullable{Int}) = "int" foo (generic function with 2 methods) julia> foo(Nullable()) "empty" julia> foo(Nullable(4)) "int" Sorry, please ignore!

Re: [julia-users] Re: Maybe, Nullable, etc

2015-05-29 Thread andrew cooke
On Friday, 29 May 2015 10:37:38 UTC-3, Yichao Yu wrote: > > On Fri, May 29, 2015 at 9:21 AM, andrew cooke > wrote: > > > > Ahh! > > > > No, its possible: > > > > > > julia> foo(::Nullable{Union()}) = "empty" > > fo

[julia-users] Re: Maybe, Nullable, etc

2015-05-29 Thread andrew cooke
then Julia needs a Maybe type as well? On Friday, 29 May 2015 10:16:40 UTC-3, andrew cooke wrote: > > > I'm not sure if I'm confused, or if there's a problem here, and I don't > know what any fix would be anyway, so apologies for the open-ended post > but...

Re: [julia-users] Re: Maybe, Nullable, etc

2015-05-29 Thread andrew cooke
On Friday, 29 May 2015 15:58:12 UTC-3, Yichao Yu wrote: > > On Fri, May 29, 2015 at 2:12 PM, andrew cooke > wrote: > > then Julia needs a Maybe type as well? > > Note that different from `Nullable{T}`, which is a type by itself, > `Maybe{T}` as proposed in the issue

[julia-users] Ann: new parser library

2015-05-31 Thread andrew cooke
There's a new parser library for Julia 0.3 and 0.4 - https://github.com/andrewcooke/SimpleParser.jl It's got some rough edges that I hope to clean up in the next week or so, with a first release probably next weekend. Bug reports welcome. It's "parser combinator" style, but uses trampolining

[julia-users] Re: Ann: new parser library

2015-05-31 Thread andrew cooke
And we already have a rename. Now known as https://github.com/andrewcooke/ParComb.jl On Sunday, 31 May 2015 11:16:43 UTC-3, andrew cooke wrote: > > > There's a new parser library for Julia 0.3 and 0.4 - > https://github.com/andrewcooke/SimpleParser.jl > > It's got

[julia-users] Re: Ann: new parser library

2015-05-31 Thread andrew cooke
2015, 19:52:34 (UTC+2), andrew cooke escribió: >> >> >> And we already have a rename. Now known as >> https://github.com/andrewcooke/ParComb.jl >> > > How about ParserCombinator.jl? > > >> >> >> On Sunday, 31 May 2015 11:16:43 UTC-3,

[julia-users] Re: Ann: new parser library

2015-05-31 Thread andrew cooke
OK https://github.com/andrewcooke/ParserCombinator.jl On Sunday, 31 May 2015 19:03:29 UTC-3, David P. Sanders wrote: > > > > El domingo, 31 de mayo de 2015, 19:52:34 (UTC+2), andrew cooke escribió: >> >> >> And we already have a rename. Now known as >> https

[julia-users] have i got equality right?

2015-06-05 Thread andrew cooke
is the following correct (the docs are not very detailed, imho)? * immutable types have equality and hash based on the values they contain, while mutable types are based on address (documented in docs for Base.is()) * if an immutable (composite) type contains a mutable (composite) type then th

[julia-users] Re: have i got equality right?

2015-06-05 Thread andrew cooke
and if so, is there a macro for immutable and type that defines == and hash automatically over the fields? thanks, andrew On Friday, 5 June 2015 15:09:08 UTC-3, andrew cooke wrote: > > > is the following correct (the docs are not very detailed, imho)? > > * immutable types ha

[julia-users] help with basic macro, please?

2015-06-05 Thread andrew cooke
i'm trying to write a macro that will define == and hash() for a composite type. my initial effort is just to define a hash of 1 using Base.Test import Base.hash function auto_hash(typ::Expr) @assert typ.head == :type quote function hash(a::$(typ.args[2])) 1

Re: [julia-users] help with basic macro, please?

2015-06-05 Thread andrew cooke
(r) > end > > println(macroexpand(:(@auto type A end))) > @auto type A end > @test typeof(A()) == A > @test hash(A()) == 1 > > println("ok") > ``` > > On Fri, Jun 5, 2015 at 7:42 PM, andrew cooke > wrote: > > i'm trying to write a ma

[julia-users] Weird type behaviour in 0.4 (bug?)

2015-06-06 Thread andrew cooke
Does this make sense to anyone? In 0.3 it works as (I) expected (once you change Void to Nothing). In 0.4 I have no idea what the float / circular reference thing is. _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialan

Re: [julia-users] Weird type behaviour in 0.4 (bug?)

2015-06-06 Thread andrew cooke
turday, 6 June 2015 15:17:39 UTC-3, Yichao Yu wrote: > > On Sat, Jun 6, 2015 at 2:15 PM, andrew cooke > wrote: > > > > Does this make sense to anyone? In 0.3 it works as (I) expected (once > you > > change Void to Nothing). > > > >

Re: [julia-users] Weird type behaviour in 0.4 (bug?)

2015-06-06 Thread andrew cooke
e) > eval_user_input at ./REPL.jl:62 > unknown function (ip: 1761907943) > jl_apply_generic at /usr/bin/../lib/julia/libjulia.so (unknown line) > anonymous at ./task.jl:84 > unknown function (ip: 1742033888) > unknown function (ip: 0) > [1]14452 segmentation fault

[julia-users] Is it possible to change an object's type at runtime?

2015-06-06 Thread andrew cooke
Is there any way to switch the "visible" type - the thing that is dispatched on - at runtime? For example, you might think that a Union() could do this, but the "visible" type is either always be the Union, and not either of the subtypes, or doesn't allow the value to be changed. julia> type

[julia-users] Re: Is it possible to change an object's type at runtime?

2015-06-07 Thread andrew cooke
why do you ask? On Sunday, 7 June 2015 10:35:10 UTC-3, David Gold wrote: > > What is the application in which you intend to use such a feature? > > On Saturday, June 6, 2015 at 6:49:53 PM UTC-4, andrew cooke wrote: >> >> >> Is there any way to switch the &quo

[julia-users] Re: Is it possible to change an object's type at runtime?

2015-06-07 Thread andrew cooke
occasionally >> useful, e.g. >> >> type A >> a::Union(Void, Int) >> end >> >> A(nothing).a = 1 >> >> On Saturday, 6 June 2015 23:49:53 UTC+1, andrew cooke wrote: >>> >>> >>> Is there any way to switch the "vi

[julia-users] Re: Is it possible to change an object's type at runtime?

2015-06-07 Thread andrew cooke
occasionally >> useful, e.g. >> >> type A >> a::Union(Void, Int) >> end >> >> A(nothing).a = 1 >> >> On Saturday, 6 June 2015 23:49:53 UTC+1, andrew cooke wrote: >>> >>> >>> Is there any way to switch the "vi

[julia-users] Re: Is it possible to change an object's type at runtime?

2015-06-07 Thread andrew cooke
it wasn't a question about making a particular application work, thanks. On Sunday, 7 June 2015 19:14:24 UTC-3, David Gold wrote: > > Just in case there is another solution that may work within the confines > of your application. > > On Sunday, June 7, 2015 at 6:01:14 PM

[julia-users] Re: Writing a mutable function (exclamation mark function)

2015-06-08 Thread andrew cooke
does this help any? julia> a = 1 1 julia> function inc() a = a+1 end inc (generic function with 1 method) julia> inc() ERROR: UndefVarError: a not defined in inc at none:2 julia> function inc() global a = a+1 end inc (generic function with 1 method) julia> inc()

[julia-users] Re: Debugging Julia code via gbd/llddb

2015-06-08 Thread andrew cooke
there's also a Debug.jl package https://github.com/toivoh/Debug.jl which can sometimes be useful. it's not great, but it makes a change from adding print statements. On Monday, 8 June 2015 08:56:48 UTC-3, axsk wrote: > > I wonder whether it is possible to debug Julia code using gdb/lldb. > So

[julia-users] Re: Why is |> deprecated?

2015-06-09 Thread andrew cooke
huh. and what exactly is deprecated? just the associated function, or the symbol too? in the next version, will it still be possible to define a meaning for |> ? On Tuesday, 9 June 2015 13:26:05 UTC-3, Simon Frost wrote: > > Dear All, > > I tried (and failed) to search for this, but I want

Re: [julia-users] Re: Why is |> deprecated?

2015-06-09 Thread andrew cooke
right, but things like that need special support in the language parser (i believe), so if the command is being dropped, maybe it is also being dropped form the parser? andrew On Tuesday, 9 June 2015 14:11:35 UTC-3, Yichao Yu wrote: > > On 2015年6月9日 星期二 10:00:23, andrew cooke &

Re: [julia-users] Re: Why is |> deprecated?

2015-06-09 Thread andrew cooke
tps://github.com/JuliaLang/julia/issues/554 >- https://github.com/JuliaLang/julia/issues/5571 >- https://github.com/JuliaLang/julia/issues/11608 > > But there's far from consensus on that. I have no special knowledge of how > that discussion is going to turn out. >

[julia-users] Current Performance w Trunk Compared to 0.3

2015-06-10 Thread andrew cooke
Is it the current poor performance / allocation a known issue? I don't know how long this has been going on, and searching for "performance" in issues gives a lot of hits, but I've been maintaining some old projects and noticed that timed tests are running significant;y slower with trunk than

Re: [julia-users] Current Performance w Trunk Compared to 0.3

2015-06-10 Thread andrew cooke
it's local too. i'll try track it down when i have a moment. thanks, andrew On Wednesday, 10 June 2015 10:30:16 UTC-3, Tim Holy wrote: > > Profiling information would be necessary to make any kind of informed > comment. > > Best, > --Tim > > On Wednesday

[julia-users] Re: Never use Containers of abstract types? Aways Union with containers of subtypes, or use containers of Typed Parameterized containers?

2015-06-11 Thread andrew cooke
i don't know of any docs that justify this, but i would assume that Union and Number would have very similar performance. also, this isn't as bad as you may think. it depends a lot on what you are doing. if you're array crunching, yes, it's a big deal, because you have to look at type tags a

[julia-users] What's [] called? ie How do I refer to the array construction function?

2015-06-17 Thread andrew cooke
If I want to pass the function that constructs an array of Any, given some values, to another function, what do I use? Here's an example that might make things clearer: julia> f(x...) = Any[x...] f (generic function with 1 method) julia> apply(f, 1,2,3) 3-element Array{Any,1}: 1 2 3 julia>

[julia-users] Re: What's [] called? ie How do I refer to the array construction function?

2015-06-17 Thread andrew cooke
that part of my question. Sorry. On Wednesday, 17 June 2015 09:45:46 UTC-3, andrew cooke wrote: > > > If I want to pass the function that constructs an array of Any, given some > values, to another function, what do I use? > > Here's an example that might make things cl

Re: [julia-users] Re: What's [] called? ie How do I refer to the array construction function?

2015-06-17 Thread andrew cooke
thanks for all the replies. i really wanted something that took *only* the contents of the array, while getindex has the type too. so i've defined my own "array" function: array(T) = (builder(x...) = T[x...]) which i can use as, say, array(Any). (the final use case is that this is given to a

Re: [julia-users] Re: What's [] called? ie How do I refer to the array construction function?

2015-06-17 Thread andrew cooke
y: > Vector{T}(dims...) > making construction of some arrays a bit clear. > > But I think the array equivalent of `tuple` is `vcat`. > > > On Wed, Jun 17, 2015 at 5:20 PM andrew cooke > wrote: > >> thanks for all the replies. >> >> i really wanted somethi

[julia-users] Create IOStream from string?

2015-06-24 Thread andrew cooke
I'm trying to test and document some routines that process files. Is there a simple way to create an IOStream from a string? >From the docs I thought IOBuffer(string) would do it, but despite what the docs say ("an in-memory I/O stream") an IOBuffer is not an IOStream. Thanks, Andrew

[julia-users] Re: Create IOStream from string?

2015-06-24 Thread andrew cooke
Oh, I think they're both subtypes of IO and I probably only need IO methods. On Wednesday, 24 June 2015 22:04:47 UTC-3, andrew cooke wrote: > > I'm trying to test and document some routines that process files. Is > there a simple way to create an IOStream from a string?

[julia-users] Re: What's the best way to implement multiple methods with similar arguments?

2015-06-27 Thread andrew cooke
the other answer is on the money, but, in this particular case, it seems to me that you might want to have a function that could take both of those, with the idea that you never get more than max_num_items, but that if you find max_iter_id before that, the sequence stops there. in that case, n

[julia-users] Re: What's the best way to implement multiple methods with similar arguments?

2015-06-28 Thread andrew cooke
On Sunday, 28 June 2015 10:13:42 UTC-3, ks wrote: > > Hello Andrew, > > Thanks! > > the other answer is on the money, but, in this particular case, it seems >> to me that you might want to have a function that could take both of those, >> with the idea that you never get more than max_num_items,

[julia-users] Re: Current Performance w Trunk Compared to 0.3

2015-06-28 Thread andrew cooke
s now back to 9 allocations (256 bytes) instead of 300,000,000 allocations (4578 MB). thanks, andrew On Wednesday, 10 June 2015 10:10:52 UTC-3, andrew cooke wrote: > > > Is it the current poor performance / allocation a known issue? > > I don't know how long this has been go

[julia-users] Re: Packed my function's parameters into a special immutable type. Expected slowdown, but my code is 20% faster. Why?

2015-06-29 Thread andrew cooke
you can compare the generated code yourself - http://blog.leahhanson.us/julia-introspects.html no real idea why it would be faster myself. the immutable is passed by value, so you're still pushing data to the stack. would have guessed it to be the same, but am no expert. andrew On Sunday,

[julia-users] Re: is there a better way to partially evaluate an expression?

2015-06-29 Thread andrew cooke
i've worried about something similar, but on a different scale - some kind of pipeline for processing (image) data, where you have a series of commands that produce intermediate images and you might go back over the commands and edit some parameter, then request that necessary work is re-compu

[julia-users] Re: Multiple dispatch for keyword arguments

2015-06-30 Thread andrew cooke
one option might be to define both with- and without-keywords versions and then call the without from the with: f(x; t) = f(x, t) f(x::Int, t::Int) = ... f(x::Number, t::Number) = ... but you may need some logic to set default values (zero() and one() may be useful). On Tuesday, 30 June 2015

[julia-users] Re: Performance regression in 0.4

2015-06-30 Thread andrew cooke
bisect is log(n)... On Tuesday, 30 June 2015 19:36:03 UTC-3, Seth wrote: > > I can't tell what changed to cause this. The versions are 35 days apart. > > On Tuesday, June 30, 2015 at 5:10:52 PM UTC-5, Kristoffer Carlsson wrote: >> >> If it is a specific commit that introduced the regression it sho

Re: [julia-users] Help in understanding Julia's ways

2015-07-06 Thread andrew cooke
i feel like these conversations are often driven by people who want "new language" to be like whatever language they are most familiar with. and those people, since they are naturally in an uncomfortable place (away from their "old" language) tend to be the most vocal. so i just wanted to add

[julia-users] Re: Deserializing a serialized datastructure causes an "end of file" error.

2015-07-07 Thread andrew cooke
that doesn't sound right. likely ether a bug in your code, your environment, or julia. can you make s small example program with the same error? On Tuesday, 7 July 2015 00:22:04 UTC-3, Gene Sher wrote: > > Hello Julia language community, > > I've developed a Neural Network based classifier usi

[julia-users] Re: questions about coroutines

2015-07-07 Thread andrew cooke
it seems to me that coroutines (Tasks) in julia are very much intended for "heavyweight" multithread use. but lazy streams are really useful in general (they transformed how i use python), and even full-on coroutines can be useful in some single-threaded applications. so i wonder if there's a

[julia-users] what are "hard" and "soft" bindings?

2015-07-07 Thread andrew cooke
i'm trying to understand the difference between "using" and "importall". i have the same confusion described at https://github.com/JuliaLang/julia/issues/11031 but, unlike the OP there, reading https://github.com/JuliaLang/julia/issues/8000 had not clarified things for me. thanks, andrew

Re: [julia-users] Re: questions about coroutines

2015-07-07 Thread andrew cooke
derlying event-driven I/O, timers, etc. > > On Tue, Jul 7, 2015 at 6:02 PM, andrew cooke > wrote: > >> >> it seems to me that coroutines (Tasks) in julia are very much intended >> for "heavyweight" multithread use. >> >> but lazy streams are really use

[julia-users] Re: Julia-lang TCO / femto-lisp TCO

2015-07-07 Thread andrew cooke
no, not really. On Tuesday, 7 July 2015 16:28:01 UTC-3, Steven G. Johnson wrote: > > > > On Tuesday, July 7, 2015 at 11:11:19 AM UTC-4, Steven Sagaert wrote: >> >> see http://blog.zachallaun.com/post/jumping-julia to work around not >> having TCO and still use recursion to traverse LARGE data str

Re: [julia-users] what are "hard" and "soft" bindings?

2015-07-07 Thread andrew cooke
ng complete different (and break all/many future > usages of the other functions in module Foo that depend on calling bar). > > Does this make more sense to you? > (And is it an answer to the question you were asking, or did I > misunderstand?) > > Best, > Leah > > On

[julia-users] Re: Did something change ~8 days ago with type parameterization in 0.4?

2015-07-07 Thread andrew cooke
what's T in the last chunk of code? you have typemax(T), but no T as a type parameter. is that really working? On Tuesday, 7 July 2015 20:03:24 UTC-3, Seth wrote: > > I have the following code: > > type MinCutVisitor{T} <: AbstractMASVisitor > graph::SimpleGraph > parities::AbstractArray{B

[julia-users] Apparent Error with Dependent Types (0.3 + 0.4)

2015-07-09 Thread andrew cooke
Before I raise an issue I wondered if I've made some stupid mistake here. The code is about as simple as I can make it. The idea behind things is that you have a field of integers module 2 (GF2). Then over that you define polynomials. And then you can define a Quotient Ring with the polyno

[julia-users] Re: Apparent Error with Dependent Types (0.3 + 0.4)

2015-07-09 Thread andrew cooke
> > > On Thursday, July 9, 2015 at 10:32:28 AM UTC-4, andrew cooke wrote: >> >> >> Before I raise an issue I wondered if I've made some stupid mistake >> here. The code is about as simple as I can make it. The idea behind >> things is that you have a fie

[julia-users] Re: Apparent Error with Dependent Types (0.3 + 0.4)

2015-07-09 Thread andrew cooke
actually it being a subtype of integer is irrelevant here, since that field is untyped. On Thursday, 9 July 2015 11:52:39 UTC-3, andrew cooke wrote: > > I want to do what I wrote, I think! In particular, the type parameter is > itself a value, the polynomial x. It's immutable

Re: [julia-users] Re: Apparent Error with Dependent Types (0.3 + 0.4)

2015-07-09 Thread andrew cooke
ah! thank-you. i had no idea about that. is there any kind of isbits container? will a tuple work? thanks again, andrew On Thursday, 9 July 2015 11:56:45 UTC-3, Yichao Yu wrote: > > On Thu, Jul 9, 2015 at 10:52 AM, andrew cooke > wrote: > > I want to do what I wrot

Re: [julia-users] Re: Apparent Error with Dependent Types (0.3 + 0.4)

2015-07-09 Thread andrew cooke
sure, i understand the reasoning, i just didn't know it was actually implemented / verified in any way. rewriting the code now... cheers, andrew On Thursday, 9 July 2015 12:03:57 UTC-3, Yichao Yu wrote: > > On Thu, Jul 9, 2015 at 10:59 AM, andrew cooke > wrote: > > &g

Re: [julia-users] Re: Did something change ~8 days ago with type parameterization in 0.4?

2015-07-09 Thread andrew cooke
update but >>> >> can you try this? >>> >> >>> >> function MinCutVisitor{T}(graph::SimpleGraph, >>> distmx::AbstractArray{T, 2}) >>> >> n = nv(graph) >>> >> MinCutVisitor{T}( >>> >> graph, >

Re: [julia-users] what are "hard" and "soft" bindings?

2015-07-09 Thread andrew cooke
, Milan Bouchet-Valat wrote: > > Le mardi 07 juillet 2015 à 15:07 -0700, andrew cooke a écrit : > > > > thanks - the accidental bug explanation makes everything clear (and > > yes, that was the question). cheers, andrew > > > > On Tuesday, 7 July 2015 17

[julia-users] Re: Composite Types With Initialized Fields

2015-07-09 Thread andrew cooke
i suspect that's by accident rather than design. it also fails on trunk with the error: ERROR: syntax: "counter=0" inside type definition is reserved andrew On Thursday, 9 July 2015 14:19:56 UTC-3, Josh Karges wrote: > > Super late to the party here. But this is an interesting side effect

Re: [julia-users] what are "hard" and "soft" bindings?

2015-07-09 Thread andrew cooke
https://github.com/JuliaLang/julia/pull/12085 On Thursday, 9 July 2015 14:47:20 UTC-3, andrew cooke wrote: > > > anyone can edit the docs, so you could add it too. > > although i just tried and got lost in github. so perhaps there's a > certain minimum leve of intellig

Re: [julia-users] Re: Apparent Error with Dependent Types (0.3 + 0.4)

2015-07-09 Thread andrew cooke
bits types, and nested tuples, you can encode pretty much any value in "s-expressions" of tuples, where the first value is a data type and subsequent values are arguments. andrew On Thursday, 9 July 2015 12:15:29 UTC-3, andrew cooke wrote: > > > sure, i understand the reasoni

[julia-users] Constructing tuples using Tuple

2015-07-10 Thread andrew cooke
sorry, more confusion... why doesn't this work? julia> Tuple{Int}(1) ERROR: MethodError: `convert` has no method matching convert(::Type{Tuple{ Int64}}, ::Int64) This may have arisen from a call to the constructor Tuple{Int64}(...), since type constructors fall back to convert methods. Closest c

Re: [julia-users] Re: Did something change ~8 days ago with type parameterization in 0.4?

2015-07-10 Thread andrew cooke
Andrew, would you mind sharing your insight here? It made things more > confusing for me, and I don't know how to troubleshott this any further. > > On Thursday, July 9, 2015 at 10:29:03 AM UTC-7, andrew cooke wrote: >> >> >> ah, that makes a certain kind of sense.

[julia-users] Re: Constructing tuples using Tuple

2015-07-10 Thread andrew cooke
can be handled consistently?). On Friday, 10 July 2015 10:40:44 UTC-3, andrew cooke wrote: > > > sorry, more confusion... why doesn't this work? > > julia> Tuple{Int}(1) > ERROR: MethodError: `convert` has no method matching convert(::Type{Tuple{ > Int64}}, ::Int6

[julia-users] Re: Constructing tuples using Tuple

2015-07-10 Thread andrew cooke
https://github.com/JuliaLang/julia/issues/8470#issuecomment-120427405 On Friday, 10 July 2015 11:09:13 UTC-3, Scott Jones wrote: > > @David I totally agree, and I don't think it's just us! Having to > remember that a trailing , is necessary for single element tuples threw me > a lot at first a

Re: [julia-users] Re: Constructing tuples using Tuple

2015-07-10 Thread andrew cooke
if it doesn't affect you that's great! means it would mean it's easy to change without worrying you... On Friday, 10 July 2015 11:57:57 UTC-3, Yichao Yu wrote: > > On Fri, Jul 10, 2015 at 10:52 AM, andrew cooke > wrote: > > https://github.com/JuliaLang/

[julia-users] Re: Read GML format graphs by using LightGraphs.jl

2015-07-16 Thread andrew cooke
hi, seth contacted me to see whether my ParserCombinator library could do this, and i've just finished adding support for GML. you can see it at https://github.com/andrewcooke/ParserCombinator.jl#parsers that is currently only available via git (not yet in a published release). i've also ema

[julia-users] OverflowError in vcat

2015-07-17 Thread andrew cooke
I appear to have an OverflowError when calling the anonymous function `x->Any[vcat(x...)]` with a large (somewhere around 15,000 entries) Vector as an argument. It works with around 1,500 (so it's not MAX_ARGS related, which was all I found in the source on a first look). Testing this on the

Re: [julia-users] OverflowError in vcat

2015-07-17 Thread andrew cooke
as this related issue: > https://github.com/JuliaLang/julia/issues/10981 > > On Fri, 2015-07-17 at 22:43, andrew cooke > > wrote: > > I appear to have an OverflowError when calling the anonymous function > > `x->Any[vcat(x...)]` with a large (somewhere around 15,00

Re: [julia-users] Re: Read GML format graphs by using LightGraphs.jl

2015-07-17 Thread andrew cooke
this point. >> >> Note also that readgml() is not type-stable, as it will create either a >> Graph or DiGraph depending on what it finds in the file. Not sure this is a >> huge problem. >> >> >> On Thursday, July 16, 2015 at 3:11:41 PM UTC-7, a

Re: [julia-users] The unique function and iterables of custom composite types

2015-07-19 Thread andrew cooke
you may be interested in https://github.com/andrewcooke/AutoHashEquals.jl, but it uses all entries. i will consider adding that feature, though (with the idea that if it's not used at all, all are used). more generally - and this may just be a problem with my programming style - i find that t

  1   2   3   4   5   >