[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gurus? Care to re-explain the absense of gh_set_x() for me?
From: |
Matthias Koeppe |
Subject: |
Re: Gurus? Care to re-explain the absense of gh_set_x() for me? |
Date: |
Fri, 13 Jul 2001 15:52:12 +0200 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.6 |
Sam Tregar <address@hidden> writes:
> On Fri, 13 Jul 2001, Martin Grabmueller wrote:
>
>> Is there a particular reason you need this type of functionality?
>
> Yes. I need to implement "+=" type operators to work on SCMs. These SCMs
> might or might not be bound at the top-level when the operator is called.
> I see no easy way to determine if they are since I have no way to scan the
> top-level defines.
>
> Simple put, how can I implement this call in C:
>
> (+= a 10)
You should not attempt to code this as a C function. += is not simply
a new procedure but needs to be a *special form* (i.e., a new syntax).
So I suggest you make a macro that expands (+= A B) into (SET! A (PLUS
A B)) and bind it to `+='. In Scheme, this is easily done with
DEFINE-MACRO; if you insist in doing this from the C level, try your
luck with the functions in `macro.h'. Then implement PLUS as a C
function that simply computes the desired value.
--
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, (continued)
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Alex Shinn, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Eric E Moore, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Rob Browning, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Miroslav Silovic, 2001/07/15
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Rob Browning, 2001/07/16
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Neil Jerram, 2001/07/14
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Miroslav Silovic, 2001/07/15
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Neil Jerram, 2001/07/16
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Miroslav Silovic, 2001/07/15
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?,
Matthias Koeppe <=
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Brett Viren, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, tom, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Matthias Koeppe, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Matthias Koeppe, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Sam Tregar, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Klaus Schilling, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Alex Shinn, 2001/07/13