(Somewhat adapted) code and solutions from the book "Build Your Own Lisp" http://www.buildyourownlisp.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
570 B

5 years ago
  1. #include <stdio.h>
  2. /* Declare a buffer for user input of size 2048 */
  3. static char input[2048];
  4. int main(int argc, char const *argv[])
  5. {
  6. /* Print version and exit information */
  7. puts("Lispy version 0.0.0.0.1");
  8. puts("Press Ctrl+c to exit\n");
  9. /* In a never ending loop */
  10. while (1) {
  11. /* Output our prompt */
  12. fputs("lispy> ", stdout);
  13. /* Read a line of user input of max size 2014 */
  14. fgets(input, 2048, stdin);
  15. /* Echo input back to user */
  16. printf("No you're a %s", input);
  17. }
  18. return 0;
  19. }