Skip to content

Proper Array setting Interface #24

Description

@mariari

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions