guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile API for foreign languages: proposing SCM scm_list_0(void)


From: Andy Wingo
Subject: Re: Guile API for foreign languages: proposing SCM scm_list_0(void)
Date: Tue, 22 Jan 2013 11:55:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

[trimming out guile-user]

For me, here is the list of symbols with no C counterpart, followed by a
commented list of all of them.

Symbols that a non-C program would need to interact with Guile:

     SCM_BOOL_F
     SCM_BOOL_T
     SCM_ELISP_NIL
     SCM_EOF_VAL
     SCM_EOL
     SCM_UNBOUND
     SCM_UNDEFINED
     SCM_UNSPECIFIED

Any ideas on how we should expose these?

Andy

Specific comments:

On Sat 12 Jan 2013 16:16, Andy Wingo <address@hidden> writes:

>     SCM_ALLOW_INTS
>     SCM_DEFER_INTS

These have scm_dynwind_block_asyncs() and related.  I removed the one
place in the docs where they were erroneously mentioned.

>     SCM_ARG1
>     SCM_ARG2
>     SCM_ARG3
>     SCM_ARG4
>     SCM_ARG5
>     SCM_ARG6
>     SCM_ARG7
>     SCM_ARGn

Not needed; these are just the numbers 1 through 7 and 0.  See "Handling
Errors" in the manual.

>     SCM_ASSERT_TYPE

There is scm_wrong_type_arg and scm_wrong_type_arg_msg

>     SCM_BOOL_F
>     SCM_BOOL_T

These are needed I guess?

>     SCM_BYTEVECTOR_CONTENTS

Probably we need scm_c_bytevector_contents() or so

>     SCM_CELL_OBJECT
>     SCM_CELL_OBJECT_0
>     SCM_CELL_OBJECT_1
>     SCM_CELL_TYPE
>     SCM_CELL_WORD
>     SCM_CELL_WORD_0
>     SCM_CELL_WORD_1
>     SCM_SET_CELL_OBJECT
>     SCM_SET_CELL_OBJECT_0
>     SCM_SET_CELL_OBJECT_1
>     SCM_SET_CELL_TYPE
>     SCM_SET_CELL_WORD
>     SCM_SET_CELL_WORD_0
>     SCM_SET_CELL_WORD_1
>     SCM_SET_SMOB_DATA
>     SCM_SET_SMOB_DATA_2
>     SCM_SET_SMOB_DATA_3
>     SCM_SET_SMOB_FLAGS
>     SCM_SET_SMOB_OBJECT
>     SCM_SET_SMOB_OBJECT_2
>     SCM_SET_SMOB_OBJECT_3
>     SCM_SMOB_DATA
>     SCM_SMOB_DATA_2
>     SCM_SMOB_DATA_3
>     SCM_SMOB_FLAGS
>     SCM_SMOB_OBJECT
>     SCM_SMOB_OBJECT_2
>     SCM_SMOB_OBJECT_2_LOC
>     SCM_SMOB_OBJECT_3
>     SCM_SMOB_OBJECT_3_LOC
>     SCM_SMOB_OBJECT_LOC

Humm, I don't know.  I would rather not expose these to other languages.

>     SCM_ELISP_NIL
>     SCM_EOF_VAL
>     SCM_EOL

These are needed, too.

>     SCM_FRAME_DATA_ADDRESS
>     SCM_FRAME_LOWER_ADDRESS
>     SCM_FRAME_UPPER_ADDRESS

Not these.

>     SCM_GLOBAL_KEYWORD
>     SCM_GLOBAL_VARIABLE
>     SCM_GLOBAL_VARIABLE_INIT
>     SCM_REGISTER_PROC
>     SCM_VARIABLE_INIT

These are snarfing-related and unneeded.

>     SCM_GPROC
>     SCM_HOOKP

Not these, I don't think.

>     SCM_IMP

Not this one, hopefully.

>     SCM_NEWSMOB
>     SCM_NEWSMOB2
>     SCM_NEWSMOB3
>     SCM_RETURN_NEWSMOB
>     SCM_RETURN_NEWSMOB2
>     SCM_RETURN_NEWSMOB3

There is scm_new_smob and scm_new_double_smob.  I have changed the
documentation to recommend them instead.

>     SCM_PTAB_ENTRY
>     SCM_PTOBNUM

Not these.

>     SCM_SIMPLE_VECTOR_LENGTH
>     SCM_SIMPLE_VECTOR_REF
>     SCM_SIMPLE_VECTOR_SET

Adequately handled by scm_c_vector interface

>     SCM_SMOB_PREDICATE

I don't know.

>     SCM_TICK

You can run scm_async_click instead; though I guess it should be called
scm_async_tick.

>     SCM_UNBNDP

A comparison to SCM_UNDEFINED is sufficient.

>     SCM_UNBOUND
>     SCM_UNDEFINED
>     SCM_UNSPECIFIED

Needed.

-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]