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

Internalisation bug #1501

Closed
athas opened this issue Oct 25, 2021 · 0 comments
Closed

Internalisation bug #1501

athas opened this issue Oct 25, 2021 · 0 comments

Comments

@athas
Copy link
Member

athas commented Oct 25, 2021

let effective_stress (d:f32) (_F_x, _F_y, F_z) = 0

let running (turning:bool) (R:f32) (v:f32) (a:f32) =
  let n = 20000
  let zs = tabulate n (\i -> f32.from_fraction i n)
  let (Fs, Ms) = unzip (map (\_ -> ((0,0,0),(0,0,0))) zs)
  in (zs, unzip3 Fs, unzip3 Ms)

let straight  = running false 0 0 0
let zs_str    = straight.0
let uczip3 (a,b,c) = zip3 a b c
let stress Fs Ms = map2 effective_stress zs_str (uczip3 Fs)
entry stress_str = stress (straight.1) (straight.2)

The problem is basically about unintended name capture, as defunctionalisation does not create programs with globally unique names.

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

No branches or pull requests

1 participant