[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sockets Layer Counter Proposal
(2012/10/11 5:18), John Cowan wrote:
If I apply the rule to constant variables, let's say AF_INET, is this
the right result?
Shiro Kawai scripsit:
If you don't like all-caps names, I'd suggest to use
a *consistent* rule to convert well-established names
to schemey-names. E.g. SOCK_STREAM -> *sock-stream*
The cl-posix-generalities page on Cliki has this set of mapping rules:
A symbol name is derived from the C binding's name, by:
1) uppercasing, then
2) replacing underscore (#\_) characters with the hyphen (#\-)
3) where the fields of a C structure all have a common prefix
(for example, "st_"), we omit it.
4) constant names get prefix and suffix '+'s.
No other changes to "Lispify" symbol names are made, so creat()
becomes CREAT, not CREATE.
Rule 1 would not be relevant to Scheme, of course. +...+ names are
valid in R7RS but not in R6RS or earlier.
1) donwcasing (schemey way I guess)
2) replacing #\_ to #\-
3) omit common prefix. here comes my question, in this case `af-'
looks like a prefix, how should we treat?
3.1) omit it
3.2) expand it (more precise name)
-> address-family-inet or address-family-internet
3.3) keep it
4) add '*' as both prefix and suffix. (+ is not a valid before R6RS so
use * instead)
If we keep name consisted with UNIX, then take 3.3 process. I'm not sure
what is the best SRFI way or Scheme way. (I believe not 3.1, though)