My Latest (and Greatest!) Project - A Lisp (like) interpreter .

This is a discussion on My Latest (and Greatest!) Project - A Lisp (like) interpreter . within the Tech Board forums, part of the Community Boards category; This is actually my first project that does something 'useful' ! Here is the code: https://github.com/manasij7479/minlisp Read the README first ...

  1. #1
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490

    My Latest (and Greatest!) Project - A Lisp (like) interpreter .

    This is actually my first project that does something 'useful' !

    Here is the code:
    https://github.com/manasij7479/minlisp

    Read the README first and if it seems interesting enough, just download the zip from the link there(top left ) and 'make' it.

    I've a challenge for anyone who builds it...: Try to crash the program !!
    (I myself have managed to do it by defining a infinitely recursive function..., but can't find anything else )

    I'd very much like a superficial (or deep...if any of you've got some time) review of my code here.
    (I know there are some gotchas to be fixed ...like avoiding const in some places and still using copy instead of move ...which I'll fix as soon an I can)

    P.S: To windows users, can you test if the code compiles cleanly over there ?
    Last edited by manasij7479; 12-02-2011 at 04:05 AM.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  2. #2
    Epy
    Epy is offline
    Hen-teaser Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    878
    C:\Users\Jake\Downloads>make
    main.cpp:7:19: warning: character constant too long for its type [enabled by def
    ault]
    main.cpp:26:17: warning: character constant too long for its type [enabled by de
    fault]
    main.cpp:26:34: warning: character constant too long for its type [enabled by de
    fault]
    main.cpp:112:95: warning: character constant too long for its type [enabled by d
    efault]
    main.cpp:114:92: warning: character constant too long for its type [enabled by d
    efault]
    main.cpp:135:38: warning: missing terminating ' character [enabled by default]
    main.cpp:135:9: error: missing terminating ' character
    main.cpp:137:9: error: stray '\342' in program
    main.cpp:137:9: error: stray '\206' in program
    main.cpp:137:9: error: stray '\221' in program
    main.cpp:138:9: error: stray '\342' in program
    main.cpp:138:9: error: stray '\206' in program
    main.cpp:138:9: error: stray '\223' in program
    main.cpp:245:127: error: invalid suffix "d9ba2309" on integer constant
    main.cpp:340:56: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:66: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:17: error: stray '#' in program
    main.cpp:340:137: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:147: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:17: error: stray '#' in program
    main.cpp:340:221: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:231: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:17: error: stray '#' in program
    main.cpp:340:305: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:315: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:17: error: stray '#' in program
    main.cpp:340:388: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:398: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:17: error: stray '#' in program
    main.cpp:340:476: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:486: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:17: error: stray '#' in program
    main.cpp:340:560: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:570: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:17: error: stray '#' in program
    main.cpp:340:641: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:651: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:754: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:764: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:811: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:821: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:980: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:990: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:1103: warning: multi-character character constant [-Wmultichar]
    main.cpp:340:1113: warning: multi-character character constant [-Wmultichar]
    main.cpp:416:5: error: stray '#' in program
    main.cpp:416:5: error: stray '#' in program
    main.cpp:429:5: error: stray '#' in program
    main.cpp:449:38: warning: character constant too long for its type [enabled by d
    efault]
    main.cpp:469:36: warning: character constant too long for its type [enabled by d
    efault]
    main.cpp:487:14: warning: character constant too long for its type [enabled by d
    efault]
    main.cpp:554:14: warning: character constant too long for its type [enabled by d
    efault]
    main.cpp:577:14: warning: character constant too long for its type [enabled by d
    efault]
    main.cpp:584:11: error: stray '\342' in program
    main.cpp:584:11: error: stray '\206' in program
    main.cpp:584:11: error: stray '\220' in program
    main.cpp:588:11: error: stray '\342' in program
    main.cpp:588:11: error: stray '\206' in program
    main.cpp:588:11: error: stray '\222' in program
    main.cpp:592:11: error: stray '\342' in program
    main.cpp:592:11: error: stray '\206' in program
    main.cpp:592:11: error: stray '\221' in program
    main.cpp:596:11: error: stray '\342' in program
    main.cpp:596:11: error: stray '\206' in program
    main.cpp:596:11: error: stray '\223' in program
    main.cpp:606:11: error: stray '\342' in program
    main.cpp:606:11: error: stray '\206' in program
    main.cpp:606:11: error: stray '\220' in program
    main.cpp:610:11: error: stray '\342' in program
    main.cpp:610:11: error: stray '\206' in program
    main.cpp:610:11: error: stray '\222' in program
    main.cpp:614:11: error: stray '\342' in program
    main.cpp:614:11: error: stray '\206' in program
    main.cpp:614:11: error: stray '\221' in program
    main.cpp:618:11: error: stray '\342' in program
    main.cpp:618:11: error: stray '\206' in program
    main.cpp:618:11: error: stray '\223' in program
    main.cpp:661:3: error: invalid preprocessing directive #This
    main.cpp:662:1: error: stray '##' in program
    main.cpp:663:1: error: stray '##' in program
    main.cpp:663:1: error: stray '##' in program
    main.cpp:663:1: error: stray '##' in program
    main.cpp:680:10: error: invalid suffix "a" on integer constant
    main.cpp:681:10: error: invalid suffix "b" on integer constant
    main.cpp:687:11: error: invalid suffix "a" on integer constant
    main.cpp:688:11: error: invalid suffix "b" on integer constant
    main.cpp:704:5: warning: missing terminating ' character [enabled by default]
    main.cpp:704:1: error: missing terminating ' character
    main.cpp:715:1: error: stray '`' in program
    main.cpp:715:1: error: stray '`' in program
    main.cpp:715:1: error: stray '`' in program
    main.cpp:718:20: warning: multi-character character constant [-Wmultichar]
    main.cpp:721:1: error: stray '`' in program
    main.cpp:721:1: error: stray '`' in program
    main.cpp:721:1: error: stray '`' in program
    main.cpp:737:1: error: stray '`' in program
    main.cpp:737:1: error: stray '`' in program
    main.cpp:4:1: error: expected unqualified-id before '<' token
    main.cpp:117:100: error: 'Graphs' does not name a type
    main.cpp:144:37: error: expected unqualified-id before '<' token
    main.cpp:340:101: error: 'iostream' does not name a type
    main.cpp:340:113: error: expected unqualified-id before '<' token
    main.cpp:340:185: error: 'list' does not name a type
    main.cpp:340:197: error: expected unqualified-id before '<' token
    main.cpp:340:269: error: 'util' does not name a type
    main.cpp:340:281: error: expected unqualified-id before '<' token
    main.cpp:340:353: error: 'env' does not name a type
    main.cpp:340:364: error: expected unqualified-id before '<' token
    main.cpp:340:436: error: 'function' does not name a type
    main.cpp:340:452: error: expected unqualified-id before '<' token
    main.cpp:340:524: error: 'repl' does not name a type
    main.cpp:340:536: error: expected unqualified-id before '<' token
    main.cpp:340:605: error: 'iostream' does not name a type
    main.cpp:340:617: error: expected unqualified-id before '<' token
    make: *** [main.o] Error 1

    C:\Users\Jake\Downloads>

  3. #3
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490
    I think it is a problem with the line endings.. (Any idea how to automatically fix that?...or would doing that bring such problems for my computer?)
    Because I can't relate any of the errors to the code convincingly..
    (It compiles without an extra word in my machine)
    Last edited by manasij7479; 12-02-2011 at 07:11 AM.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  4. #4
    Epy
    Epy is offline
    Hen-teaser Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    878
    Might be because I downloaded the files manually. I don't have Git on my work comp.

  5. #5
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490
    Quote Originally Posted by Epy View Post
    Might be because I downloaded the files manually. I don't have Git on my work comp.
    Even when downloading (the zip) manually it compiles for me.
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  6. #6
    Epy
    Epy is offline
    Hen-teaser Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    878
    It worked fine with the zip. They need a bigger button for the zip download because I didn't see that button at all when I went to the page before.

  7. #7
    Epy
    Epy is offline
    Hen-teaser Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    878
    Typing in the EOF character makes it printout [minlisp] nonstop though.

  8. #8
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490
    Quote Originally Posted by Epy View Post
    Typing in the EOF character makes it printout [minlisp] nonstop though.
    Happens for me too..
    I tried iscntrl() but it did not work..(i.e.. no effect).
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My Latest Project
    By CrazyNorman in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 05-29-2007, 09:38 PM
  2. Replies: 17
    Last Post: 05-07-2006, 06:11 PM
  3. Replies: 2
    Last Post: 09-09-2004, 12:57 PM
  4. IDEA: LISP Interpreter
    By ygfperson in forum Contests Board
    Replies: 4
    Last Post: 09-13-2002, 08:48 PM
  5. Latest and greatest Problem
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 03-18-2002, 09:37 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21