[Top][All Lists]

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

Re: Release 1.6 critical TODO items.

From: Marius Vollmer
Subject: Re: Release 1.6 critical TODO items.
Date: 30 Jan 2002 21:34:53 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Rob Browning <address@hidden> writes:

>   $ guile
>   guile> (gensym)                 
>   %%gensym0
>   guile> (eq? '%%gensym1 (gensym))
>   #f
>   guile> (define foo (gensym))    
>   guile> (eq? '%%gensym3 foo)     
>   #t
>   guile> foo
>   %%gensym3
>   guile> 
> Somehow even just assigning (gensym)'s result to foo interns it.  Is
> that expected?

No.  Strange.  I added this

    scm_mem2symbol_uninterned (const char *name, size_t len)
      size_t raw_hash = scm_string_hash ((const unsigned char *) name, len);
      size_t hash = raw_hash % SCM_VECTOR_LENGTH (symbols);

      return scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len),
                                    (scm_t_bits) scm_must_strndup (name, len),
                                    SCM_UNPACK (scm_cons (SCM_BOOL_F,

    SCM_DEFINE (scm_make_symbol, "make-symbol", 1, 0, 0,
                (SCM name),
    #define FUNC_NAME s_scm_make_symbol
      SCM sym;
      SCM_VALIDATE_STRING (1, name);
      sym = scm_mem2symbol_uninterned (SCM_STRING_CHARS (name),
                                       SCM_STRING_LENGTH (name));
      scm_remember_upto_here_1 (name);
      return sym;
    #undef FUNC_NAME

and I get, as expected:

    guile> (define foo (make-symbol "foo"))
    guile> foo
    guile> (eq? 'foo foo)
    guile> (eq? 'bar (make-symbol "bar"))   

reply via email to

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