Re: how to assign a Scheme procedure to an SCM variable?

2024-01-05 Thread Werner LEMBERG


> You can't -- scm_boolean_p is a C function, not a Guile function.
> (It's sort of like trying to access a chocolate as a chocolate box.)
> What you can do is to import boolean? from Guile using
> lily-imports.cc.

That worked, thanks!


Werner



Re: how to assign a Scheme procedure to an SCM variable?

2024-01-05 Thread Jean Abou Samra
You can't -- scm_boolean_p is a C function, not a Guile function.
(It's sort of like trying to access a chocolate as a chocolate box.)
What you can do is to import boolean? from Guile using lily-imports.cc.




signature.asc
Description: This is a digitally signed message part


how to assign a Scheme procedure to an SCM variable?

2024-01-05 Thread Werner LEMBERG


Folks,


I ask for help with a Guile question.

Naively, I tried

```
SCM proc = scm_boolean_p;
```

However, this bombs out with

```
error: cannot convert 'scm_unused_struct* (*)(SCM)'
   {aka 'scm_unused_struct* (*)(scm_unused_struct*)'}
   to 'SCM' {aka 'scm_unused_struct*'}
```

What is the correct way to assign a built-in procedure like `boolean?`
(i.e., `scm_boolean_p`) to a variable of type `SCM`?


Werner