Skip to content

Use make-prefab-struct instead of constructor for prefab structs #4

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

Closed
wants to merge 1 commit into from

Conversation

AlexKnauth
Copy link
Member

closes #3

@samth
Copy link
Member

samth commented Sep 20, 2015

I think there are tests for pconvert somewhere.

Also, you might use for/list and in-vector to avoid the intermediate list.

AlexKnauth added a commit to AlexKnauth/compatibility that referenced this pull request Sep 20, 2015
@AlexKnauth
Copy link
Member Author

I just added a test.

@AlexKnauth
Copy link
Member Author

For that I used the same pattern as https://github.com/racket/pconvert-lib/pull/4/files#diff-cb76abd3c1f365f0647a55475b35155eL475 a few lines later, but with a direct use of recur instead of a lambda.

@AlexKnauth
Copy link
Member Author

What do you think?

@samth
Copy link
Member

samth commented Sep 20, 2015

Looks reasonable to me. Avoiding the intermediate list would look like

(for/list ([i (in-vector (struct->vector expr)]
           [j (in-naturals)]
           #:unless (zero? j))
  (recur i))

@samth
Copy link
Member

samth commented Sep 20, 2015

Up to you. That could also be a separate change -- I think this is good to go as is.

@AlexKnauth
Copy link
Member Author

I think it should be a separate change.

@AlexKnauth
Copy link
Member Author

I'll make a separate pull request after.

@AlexKnauth
Copy link
Member Author

Are you going to merge?

@samth
Copy link
Member

samth commented Sep 20, 2015

Done.

@samth samth closed this Sep 20, 2015
@AlexKnauth AlexKnauth deleted the patch-1 branch September 20, 2015 23:32
samth pushed a commit to racket/compatibility that referenced this pull request Sep 20, 2015
@AlexKnauth
Copy link
Member Author

Is for not provided by mzscheme?

@samth
Copy link
Member

samth commented Sep 20, 2015

That wouldn't shock me. Porting the code to racket/base would also be nice ...

AlexKnauth added a commit to AlexKnauth/pconvert-lib that referenced this pull request Sep 20, 2015
samth pushed a commit that referenced this pull request Dec 22, 2016
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

Successfully merging this pull request may close these issues.

Prefab structs
2 participants