[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gEDA-dev: some suggestions
On Fri, 15 Dec 2006, Carlos Nieves Ónega wrote:
> Hi Peter,
>
> El jue, 14-12-2006 a las 22:25 +0000, Peter TB Brett escribió:
> [snip]
>> I think that a more elegant way to do it would be for:
>>
>> (define default-titleblock nil)
>>
>> to disable the titleblock[1], and
>>
>> (define default-titleblock "")
>>
>> to give a warning as before.
>>
>> I'd submit a revised patch myself, but I think you'd be able to change it
>> faster than I could find the right piece of code. ;)
>>
>> Cheers,
>>
>> Peter
>>
>> [1] Am I right in thinking that 'nil' in Scheme has the same meaning as in
>> ANSI Lisp, i.e. null?
>
> I'm not sure about it. It seems that in guile, null? checks for an empty
> list, and nil is used for lisp compatibility.
>
> I wouldn't like to use null for this issue, because the component name
> is not a list.
>
> The piece of code doing that kind of work seems to be:
> if (SCM_NFALSEP(scm_eq_p(scm_comp_name, SCM_NIL))) {
> return SCM_BOOL_F;
> }
> SCM_NIL doesn't exist. Anyone knows a way to do it?
I think you might want
if(SCM_NILP(scm_comp_name)) {
At a higher design level though, it does appear that "nil" in scheme is
only present for compatibility with other lisps. It definitely is not
equal to the empty list or to #f (boolean false).
I don't know for sure what the properly schemey tradition would suggest
using here, but (null? comp_name) to test for the empty list might be
considered better by the purists.
In C, that's
if(SCM_NULLP(scm_comp_name))
(which is very different a C NULL pointer)
Steve
_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev