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

Lift #201

Open
ocots opened this issue Jul 16, 2024 · 2 comments · Fixed by #211
Open

Lift #201

ocots opened this issue Jul 16, 2024 · 2 comments · Fixed by #211
Assignees
Labels
enhancement New feature or request

Comments

@ocots
Copy link
Member

ocots commented Jul 16, 2024

A lift of a function should return a function.

@ocots
Copy link
Member Author

ocots commented Aug 5, 2024

En fait, cela ne permet toujours pas de faire :

F(x) = 2x
H = Lift(F)
H(t) = H(t, t)

On a une erreur :

julia> H(t) = H(t, t)
ERROR: cannot define function H; it already has a value
Stacktrace:
 [1] top-level scope
   @ none:0
 [2] top-level scope
   @ REPL[6]:1

En fait, on peut faire (et on pouvait déjà faire) :

F(x) = 2x
H(x, p) = Lift(F)(x, p)
H(t) = H(t, t)

@ocots ocots linked a pull request Aug 5, 2024 that will close this issue
@jbcaillau
Copy link
Member

@ocots agreed. the allowed / forbidden combinations are:

julia> f = 1
1

julia> f(x) = 2
ERROR: cannot define function f; it already has a value
Stacktrace:
 [1] top-level scope
   @ none:0
 [2] top-level scope
   @ REPL[64]:1

julia> f = x -> 2
#123 (generic function with 1 method)

julia> g(x) = 3
g (generic function with 1 method)

julia> g = 4
ERROR: invalid redefinition of constant Main.g
Stacktrace:
 [1] top-level scope
   @ REPL[67]:1

julia> g(x, y) = 4
g (generic function with 2 methods)

A function (not a functional value, aka lambda) can have several definitions (multiple dispatch).

Regarding Poisson, not clear from the PR whether we can completely bypass the Lift constructor and bracket mere functions of x and p?

@jbcaillau jbcaillau reopened this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants