New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port "Fcdr()" and "cdr()" to Rust #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from a teeny-tiny docstring issue, looks great! :)
cdr(list) | ||
} | ||
|
||
defun!("cdr", Fcdr, Scdr, 1, 1, ptr::null(), " Return the cdr of LIST. If arg is nil, return nil. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit: could you remove the space before Return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
Sorry for bringing this up but I'd like to ask some questions about implementation details (hope they're not too trivial):
#[repr(C)]
#[allow(unused_variables)]
struct LispCons {
car: LispObject,
cdr: LispObject,
}
#[repr(C)]
#[allow(dead_code)]
pub struct LispConsChain {
chain: *const LispCons,
} achieves the same behaviour of C union? Does this mean we'll use
unsafe fn Foo() { ... } and fn Foo() { unsafe { } } |
1: Yep, exactly. We'll use I'm open to suggestions of cleaner approaches, but I think the current approach is reasonable. 2: 3: See #63, but do let me know if it's unclear. |
No description provided.