Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

godfuckingdamnit!/prog/

Name: Anonymous 2010-02-06 15:49

hey /prog/

im writing a lisp interpreter from scratch in C (or rather trying to) and i dont know how to represent a general lisp object . i also dont know how to implement ˝lambda˝ and ˝apply˝ , or rather a function which generates a function and returns its address.

any ideas /prog/ ?
is it even possible to write a function that generates a function in C ?
and how the fuck does one make a struct member with undefined lenght/variable ?

Name: Anonymous 2010-02-06 16:27

>>3
In ANSI C? No.
Let's say you malloc some memory, copy an assembled (platform-specific), possibly base-independent(or perform relocations if it's not) function, cast that pointer to a function pointer, and call it. Which part makes it non-ANSI C? The casting of the pointer to a function type or the execution of the function code(which contains platform dependent code, and doing such thing is likely undefined by the ANSI C standard) or both?. I have yet to see a real ANSI C implementation where this doesn't work, however it's pretty clear that executing the code at that pointer is undefined by the standard, however I'm not so sure about that cast (it's probably undefined too?).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List