lindahua/DeExpr.jl — pull request #16 by tshort (2013-02-05 15:27:21+00:00)
Title: Change get_value to support AbstractArrays

This change allows DeExpr to support other types of arrays. In my case, I'm trying to support DataArrays from the DataFrames package. In limited tests, it works for these as shown in the following example.

```julia
julia> using DeExpr

julia> using DataFrames

julia> y = DataArray(rand(20)); z = DataArray(rand(20));

julia> @devec qq = z + sum(y)

julia> qq
20-element Float64 Array:
11.7672
11.3512
11.2738
11.3375
11.5469
11.0168
11.3229
11.3306
11.5245
11.8921
11.6288
11.8499
11.3345
11.4582
11.4204
11.2061
11.138
11.3784
11.2421
11.1906

julia> q = DataArray(Float64,20) # for a DataArray result
20-element Float64 DataArray:
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA

julia> @devec q[:] = z + sum(y)

julia> q
20-element Float64 DataArray:
11.7672
11.3512
11.2738
11.3375
11.5469
11.0168
11.3229
11.3306
11.5245
11.8921
11.6288
11.8499
11.3345
11.4582
11.4204
11.2061
11.138
11.3784
11.2421
11.1906

julia> z[[1,5]] = NA
NA

julia> @devec q[:] = z + sum(y)

julia> q
20-element Float64 DataArray:
NA
11.3512
11.2738
11.3375
NA
11.0168
11.3229
11.3306
11.5245
11.8921
11.6288
11.8499
11.3345
11.4582
11.4204
11.2061
11.138
11.3784
11.2421
11.1906

```