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

Proper Array setting Interface #24

Open
mariari opened this issue May 31, 2022 · 0 comments
Open

Proper Array setting Interface #24

mariari opened this issue May 31, 2022 · 0 comments

Comments

@mariari
Copy link
Member

mariari commented May 31, 2022

Currently the setf interface for array setting is quite imperative. which makes it clash with the compilation model, however @paulcadman suggested a more functional form like

(defcircuit array-creation-check ((output (array int 10)))
  (def ((bar  (array 10 (int 32)))
        (init (initalize (array 10 (int 32))
                         0 (check 23 (int 32))
                         1 25
                         2 30)))
    (+ 25 (get init 0) (get init 1))))

which will replace

(defcircuit array-creation-check ((output (array int 10)))
  (def ((foo (array 10 (int 32)))
        (bar (array 10 (int 32))))
    (setf (prld:get foo 0) (prld:check 23 (int 32)))
    (setf (prld:get foo 1) 25)
    (prld:+ 25 (prld:get foo 0) (prld:get foo 1))))

which gives arrays a much better interface that is true to the model

@mariari mariari changed the title Proper Array Interface Proper Array setting Interface May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant