bradb Posted July 13, 2009 Posted July 13, 2009 Command: hole Hard error occurred *** internal stack limit reached (simulated) Hole is a lisp I wrote. Problem is when I run it, it gives me this error. If I reload it and type hole agian it works. Can someone tell me what this error means? Quote
jammie Posted July 13, 2009 Posted July 13, 2009 Do you have a sample of the code that you can post? In particular any snipet that uses the WHILE or REPEAT functions Quote
bradb Posted July 13, 2009 Author Posted July 13, 2009 Heres th Lisp However I don not have it in the start up suite by call it like this (defun c:HOLE () (if (not hole)(load "c:\\lisp\\hole")) (c:hole) ) HOLE.lsp Quote
Lee Mac Posted July 13, 2009 Posted July 13, 2009 Take the (c:hole) out of the function definition, otherwise you are calling it recursively, hence causing a stack limit error. Else, call the loading function a different name. Quote
bradb Posted July 13, 2009 Author Posted July 13, 2009 Take the (c:hole) out of the function definition, otherwise you are calling it recursively, hence causing a stack limit error. Else, call the loading function a different name. By doing that command comes back nil Quote
Commandobill Posted July 13, 2009 Posted July 13, 2009 Heres th Lisp However I don not have it in the start up suite by call it like this (defun c:HOLE () (if (not hole)(load "c:\\lisp\\hole")) (c:hole) ) (defun c:HOLE () (load "c:\\lisp\\hole[color=Red][b].LSP[/b][/color]")) (c:hole) ) Basically your 'if' statement was always going to return true. But it wasnt loading the new lisp due to the lack of the ".lsp" and then it was running the same lisp over and over. Quote
Commandobill Posted July 14, 2009 Posted July 14, 2009 I know you didnt ask for it but I was bored and havent had a good idea for a lisp in a while so i rewrote the beginning of your hole lisp removing all the 'menu's and adding a few checks in there. hope you dont mind (defun c:HOLE (/ OPT) (while (and (not (initget "Unified Metric Quit")) (not (setq OPT (getkword "\nUnified/Metric/Quit: "))))) (if (/= OPT "Quit") (progn (while (and (not (initget "Drilled Tapped Quit")) (not (setq OPT1 (getkword "\nDrilled/Tapped/Quit: "))))) (if (/= OPT1 "Quit") (progn (while (if (and (setq HDIA (getdist "\nEnter Hole Diameter: ")) (setq HDEP (getdist "\nEnter Hole Depth: "))) nil t)) (if (= OPT1 "Tapped") (while (not (setq HPIT (getreal "\nEnter Pitch of Threads: "))))) (while (and (not (initget "Plan Side Quit")) (not (setq OPT2 (getpoint "\nPlan/Side/Quit: "))))) (if (/= OPT2 "Quit") (cond ((and (= OPT "Drilled") (= OPT1 "Unified")) (if (= OPT2 "Plan") (Unified_Drilled_Plan) (Unified_Drilled_Side))) ((and (= OPT "Drilled") (= OPT1 "Metric")) (if (= OPT2 "Plan") (Metric_Drilled_Plan) (Metric_Drilled_Side))) ((and (= OPT "Tapped") (= OPT1 "Unified")) (if (= OPT2 "Plan") (Unified_Tapped_Plan) (Unified_Tapped_Side))) ((and (= OPT "Tapped") (= OPT1 "Metric")) (if (= OPT2 "Plan") (Metric_Tapped_Plan) (Metric_Tapped_Side))) )))))) ) Quote
Lee Mac Posted July 14, 2009 Posted July 14, 2009 I was also bored (defun c:hole (/ ans1 ans2 ans3 hdia hdep hpit) (while (progn (initget "Unified Metric Quit") (setq ans1 (getkword "\nUnified/Metric/Quit: ")) (cond ((eq "Quit" ans1) nil) (t (while (progn (initget "Drilled Tapped Quit") (setq ans2 (getkword "\nDrilled/Tapped/Quit: ")) (cond ((eq "Quit" ans2) nil) (t (while (not (and (setq hdia (getdist "\nEnter Hole Diameter: ")) (setq hdep (getdist "\nEnter Hole Depth: ")))) (princ "\n** Incorrect Specification **")) (if (eq "Tapped" ans1) (while (not (setq hpit (getreal "\nEnter Pitch of Threads: "))) (princ "\n** Incorrect Specification **"))) (while (progn (initget "Plan Side Quit") (setq ans3 (getkword "\nPlan/Side/Quit: ")) (cond ((eq "Quit" ans3) nil) ((eq ans2 "Drilled") (cond ((eq ans1 "Unified") (if (eq ans3 "Plan") (Unified_Drilled_Plan) (Unified_Drilled_Side))) ((eq ans1 "Metric") (if (eq ans3 "Plan") (Metric_Drilled_Plan) (Metric_Drilled_Side))))) ((eq ans2 "Tapped") (cond ((eq ans1 "Unified") (if (eq ans3 "Plan") (Unified_Tapped_Plan) (Unified_Tapped_Side))) ((eq ans1 "Metric") (if (eq ans3 "Plan") (Metric_Tapped_Plan) (Metric_Tapped_Side))))) (t t))))))))))))) Quote
Commandobill Posted July 14, 2009 Posted July 14, 2009 I was also bored I say potato you say "poh-tah-toe" I forgot to localize my variables. Long live the queen. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.