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

Type format for CL. #31

Open
mariari opened this issue Jun 22, 2022 · 0 comments
Open

Type format for CL. #31

mariari opened this issue Jun 22, 2022 · 0 comments

Comments

@mariari
Copy link
Member

mariari commented Jun 22, 2022

It would be nice if we could request type information from alucard terms in CL functions

(defun reshape (array new-element-type) 
  (with-requested-type array array-type
    (match array-type
      ((array length type)
       (coerce array
              (array
               (* length
                  (cl:- (element-size element-type) (element-size type)))
               new-element-type)))))

with that this code can be made. Meaning that we can offer a more safe way to reshape an array form CL. rather than just doing the math in our head.

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