Passing null as a string

22 views
Skip to first unread message

David Smith

unread,
Jun 3, 2021, 6:00:24 PM6/3/21
to ats-lang-users
I'm trying to wrap a library that has a function that takes a `char *`, and optionally NULL.

I tried strptr, string, and other random types I found in the prelude. Now I'm trying to pass NULL (using `the_null_ptr`; great name btw), and I'm getting type errors.

Which string should I use here, and how would I pass null?

Thanks in advance.

Troy Jacobs

unread,
Jun 3, 2021, 6:23:57 PM6/3/21
to ats-lan...@googlegroups.com
I would suggest either trying the "stropt" type or the "Option_vt" type.  Would you mind sharing a snippet of code, so that we could get a better understanding of what you are trying to do?

--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/75f5caf2-e3e7-4619-b063-e8502de781a0n%40googlegroups.com.

David Smith

unread,
Jun 3, 2021, 6:36:57 PM6/3/21
to ats-lang-users
Yes! stropt seems to be exactly what I want. Thank you!

Troy Jacobs

unread,
Jun 3, 2021, 6:37:59 PM6/3/21
to ats-lan...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages