Skip to content

Nested . syntaxΒ #20502

Open
Open
@davidanthoff

Description

Would it make sense to allow "nested" application of the . syntax for broadcasting? For example

a = rand(3); b = rand(3);
c = [a, b]
log..(c)

Would translate to

broadcast(i->log.(i),c)

and then

broadcast(i->broadcast(j->log(j), i),c)

I imagine this would be especially useful with Nullables, and arrays of Nullables. For example, this would work:

a = [Nullable(3.), Nullable(2.)]
log..(a)

The first dot would apply log. to each array element. And because we have now used log. on the array elements, we get the nice new lifting for these values.

Even crazy things like this would work:

a = Nullable([Nullable(3.), Nullable(2.)])
log...(a)

Here the first dot would lift, the second dot would apply to the elements of the array, and the third dot would lift again.

I think that also relates to the issue that @JeffBezanson had here.

I have to admit that I didn't follow the whole Nullable discussion lately, in which case I'm sorry to bring this up again.

@nalimilan, @davidagold, @johnmyleswhite Not sure who else might be interested.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collectionmissing dataBase.missing and related functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions