Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector-scalar concatenation doesn't work #116

Closed
ghost opened this issue Jul 15, 2011 · 4 comments
Closed

Vector-scalar concatenation doesn't work #116

ghost opened this issue Jul 15, 2011 · 4 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@ghost
Copy link

ghost commented Jul 15, 2011

You can't concatenate a vector with a scalar: [[1,2,3],4] is wrong, [[1,2,3],[4]] is right.

@ViralBShah
Copy link
Member

julia> hcat([1,2,3],4)
no promotion exists for Array{Int32,1} and Int32

I get the same error even if I implement:

hcat{T}(V::(Union(T,Array{T,1}))...) = [ V[j][i] | i=1:length(V[1]), j=1:length(V) ]

@ghost ghost assigned ViralBShah Jul 16, 2011
@ViralBShah
Copy link
Member

I get the same error if I use Number. I guess Number{T} no longer exists. What is the right way to do this?

hcat{T}(V::Union(Number,Array{T,1})...) = [ V[j][i] | i=1:length(V[1]), j=1:length(V) ]

@ViralBShah
Copy link
Member

Shouldn't this give a "method not found" error? How come it is matching with hcat on vectors, and then barfing on promote?

julia> [[1,2,3], 4]
no promotion exists for Array{Int64,1} and Int64

@JeffBezanson
Copy link
Member

It's calling hcat(X...) which calls cat(catdim::Int, X...).

KristofferC added a commit that referenced this issue Feb 9, 2018
* use a charbuffer to write read chars into, instead of creating Char arrays everywhere
* be more careful with using stream seeking operations like position, mark, seek, this are kinda slow
NHDaly pushed a commit that referenced this issue May 22, 2024
NHDaly pushed a commit that referenced this issue May 22, 2024
DilumAluthge added a commit that referenced this issue Dec 17, 2024
Stdlib: Distributed
URL: https://github.com/JuliaLang/Distributed.jl
Stdlib branch: master
Julia branch: master
Old commit: 6c7cdb5
New commit: c613685
Julia version: 1.12.0-DEV
Distributed version: 1.11.0(Does not match)
Bump invoked by: @DilumAluthge
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Distributed.jl@6c7cdb5...c613685

```
$ git log --oneline 6c7cdb5..c613685
c613685 Merge pull request #116 from JuliaLang/ci-caching
20e2ce7 Use julia-actions/cache in CI
9c5d73a Merge pull request #112 from JuliaLang/dependabot/github_actions/codecov/codecov-action-5
ed12496 Merge pull request #107 from JamesWrigley/remotechannel-empty
010828a Update .github/workflows/ci.yml
11451a8 Bump codecov/codecov-action from 4 to 5
8b5983b Merge branch 'master' into remotechannel-empty
729ba6a Fix docstring of `@everywhere` (#110)
af89e6c Adding better docs to exeflags kwarg (#108)
8537424 Implement Base.isempty(::RemoteChannel)
6a0383b Add a wait(::[Abstract]WorkerPool) (#106)
1cd2677 Bump codecov/codecov-action from 1 to 4 (#96)
cde4078 Bump actions/cache from 1 to 4 (#98)
6c8245a Bump julia-actions/setup-julia from 1 to 2 (#97)
1ffaac8 Bump actions/checkout from 2 to 4 (#99)
8e3f849 Fix RemoteChannel iterator interface (#100)
f4aaf1b Fix markdown errors in README.md (#95)
2017da9 Merge pull request #103 from JuliaLang/sf/sigquit_instead
07389dd Use `SIGQUIT` instead of `SIGTERM`
```

Co-authored-by: Dilum Aluthge <[email protected]>
stevengj pushed a commit that referenced this issue Jan 2, 2025
Stdlib: Distributed
URL: https://github.com/JuliaLang/Distributed.jl
Stdlib branch: master
Julia branch: master
Old commit: 6c7cdb5
New commit: c613685
Julia version: 1.12.0-DEV
Distributed version: 1.11.0(Does not match)
Bump invoked by: @DilumAluthge
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Distributed.jl@6c7cdb5...c613685

```
$ git log --oneline 6c7cdb5..c613685
c613685 Merge pull request #116 from JuliaLang/ci-caching
20e2ce7 Use julia-actions/cache in CI
9c5d73a Merge pull request #112 from JuliaLang/dependabot/github_actions/codecov/codecov-action-5
ed12496 Merge pull request #107 from JamesWrigley/remotechannel-empty
010828a Update .github/workflows/ci.yml
11451a8 Bump codecov/codecov-action from 4 to 5
8b5983b Merge branch 'master' into remotechannel-empty
729ba6a Fix docstring of `@everywhere` (#110)
af89e6c Adding better docs to exeflags kwarg (#108)
8537424 Implement Base.isempty(::RemoteChannel)
6a0383b Add a wait(::[Abstract]WorkerPool) (#106)
1cd2677 Bump codecov/codecov-action from 1 to 4 (#96)
cde4078 Bump actions/cache from 1 to 4 (#98)
6c8245a Bump julia-actions/setup-julia from 1 to 2 (#97)
1ffaac8 Bump actions/checkout from 2 to 4 (#99)
8e3f849 Fix RemoteChannel iterator interface (#100)
f4aaf1b Fix markdown errors in README.md (#95)
2017da9 Merge pull request #103 from JuliaLang/sf/sigquit_instead
07389dd Use `SIGQUIT` instead of `SIGTERM`
```

Co-authored-by: Dilum Aluthge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants