Skip to content

DeprecatedLarcenyExtensions

Felix S. Klock II edited this page Jul 28, 2013 · 2 revisions

== Deprecated Larceny Extensions ==

list*

This procedure will be renamed cons* for compatibility with the R6RS.

some?, every?

These procedures will be renamed exists and for-all for compatibility with the R6RS.

list-set!, remove!, remq!, remv!, remp!, revappend!, reverse!, set-last!

Side effects on lists are usually a bad idea.

getprop, putprop, remprop

Property lists are nonstandard and obsolete. Use hashtables (with symbol-hash) instead.

sort, sort!

Because these are nonstandard, the R6RS sorting procedures (list-sort, vector-sort, vector-sort!) should be used instead.

integer-logX, fxlogX, fxrsha, fxrshl, fxlsh

Although these procedures are perfectly safe, their semantics is slightly more implementation-dependent than their R6RS equivalents, which should be used instead.

hashtables

Although Larceny's hashtables are (for the most part) better than SRFI 69 hashtables, the R6RS hashtables library is better still and should replace Larceny's hashtable procedures. The following table shows the R6RS equivalent for Larceny's oldstyle hashtables, where <searcher> is assumed to be equivalent to (lambda (x y) (assp <equiv> x y)).


Larceny's oldstyle hashtables                   R6RS equivalent
-----------------------------                   ---------------
(make-hashtable)                                (make-eqv-hashtable)
(make-hashtable )                      (make-eqv-hashtable)
(make-hashtable  )           (make-hashtable  )
(make-hashtable   )    (make-hashtable   )
(hashtable? )                               (hashtable? )
(hashtable-size )                           (hashtable-size )
(hashtable-fetch   )          (hashtable-ref   )
(hashtable-get  )                      (hashtable-ref   #f)
(hashtable-put!   )             (hashtable-set!   )
(hashtable-remove!  )                  (hashtable-delete!  )
(hashtable-contains?  )                (hashtable-contains?  )
(hashtable-copy )                           (hashtable-copy  #t)
(hashtable-clear! )                         (hashtable-clear! )
(hashtable-for-each  )                (call-with-values
                                                 (hashtable-entries)
                                                 (lambda (keys values)
                                                   (vector-for-each  keys values)))
(hashtable-map  )                     (call-with-values
                                                 (hashtable-entries)
                                                 (lambda (keys values)
                                                   (vector->list
                                                    (vector-map  keys values))))

In Larceny v0.95 only, Larceny's oldstyle make-hashtable has been renamed to make-oldstyle-hashtable, and the make-hashtable procedure delegates to make-oldstyle-hashtable. After v0.95, make-hashtable will delegate to make-r6rs-hashtable, which is Larceny's name for the R6RS make-hashtable procedure. Later on, make-oldstyle-hashtable and make-r6rs-hashtable will become deprecated and will eventually disappear, leaving only R6RS-style hashtables.

with-input-from-port, with-output-to-port, with-output-from-string, with-output-to-string

These procedures implement a paradigm that breaks down in multithreaded programs.

Clone this wiki locally