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

optional arguments in cgen's define-cptr are not effective #59

Closed
pclouds opened this issue Apr 30, 2015 · 3 comments
Closed

optional arguments in cgen's define-cptr are not effective #59

pclouds opened this issue Apr 30, 2015 · 3 comments

Comments

@pclouds
Copy link
Contributor

pclouds commented Apr 30, 2015

I have a declaration like this

(define-cptr <git-repository> "git_repository*" "Git_RepositoryClass"
  "GIT_REPOP" "GIT_REPO" "GIT_REPO_VALUE"
  :print repo-print
  :cleanup repo-cleanup)

but the generated code is

Git_RepositoryClass = Scm_MakeForeignPointerClass(Scm_CurrentModule(),"<git-repository>", NULL, NULL, 0);

cleanup-proc and print-proc are not passed to that call. Adding #?= at line 1665 in cgen/stub.scm i got

#?="/home/pclouds/opt/gauche/share/gauche-0.9/0.9.5_pre1/lib/gauche/cgen/stub.scm":1665:(assq-ref clauses 'print)
#?-    #f
@shirok
Copy link
Owner

shirok commented Apr 30, 2015

Try

(define-cptr <git-repository> "git_repository*" "Git_RepositoryClass"
  "GIT_REPOP" "GIT_REPO" "GIT_REPO_VALUE"
  (print repo-print)
  (cleanup repo-cleanup))

From: Nguyễn Thái Ngọc Duy notifications@github.com
Subject: [Gauche] optional arguments in cgen's define-cptr are not effective (#59)
Date: Thu, 30 Apr 2015 07:50:31 -0700

I have a declaration like this

(define-cptr <git-repository> "git_repository*" "Git_RepositoryClass"
  "GIT_REPOP" "GIT_REPO" "GIT_REPO_VALUE"
  :print repo-print
  :cleanup repo-cleanup)

but the generated code is

Git_RepositoryClass = Scm_MakeForeignPointerClass(Scm_CurrentModule(),"<git-repository>", NULL, NULL, 0);

cleanup-proc and print-proc are not passed to that call. Adding #?= at line 1665 in cgen/stub.scm i got

#?="/home/pclouds/opt/gauche/share/gauche-0.9/0.9.5_pre1/lib/gauche/cgen/stub.scm":1665:(assq-ref clauses 'print)
#?-    #f

Reply to this email directly or view it on GitHub:
#59

@pclouds
Copy link
Contributor Author

pclouds commented Apr 30, 2015

That seems to work. Thank you. I mistook it for keyword syntax. define-cptr should probably error out on unrecognized arguments though.

@shirok
Copy link
Owner

shirok commented May 1, 2015

That's reasonable.

From: Nguyễn Thái Ngọc Duy notifications@github.com
Subject: Re: [Gauche] optional arguments in cgen's define-cptr are not effective (#59)
Date: Thu, 30 Apr 2015 16:39:59 -0700

That seems to work. Thank you. I mistook it for keyword syntax. define-cptr should probably error out on unrecognized arguments though.


Reply to this email directly or view it on GitHub:
#59 (comment)

@shirok shirok closed this as completed May 1, 2015
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

2 participants