Search found 10 matches

by refrainrence
Mon Mar 17, 2014 10:59 pm
Forum: newLISP in the real world
Topic: FOOP recursive method
Replies: 4
Views: 1182

Re: FOOP recursive method

Below the corrected code mentioned first in this thread. I'll try to add a word about nested quote to the topic title. And maybe a word that it's solved. I should check what the forum rules say about it :-) If some expert could add a word to my newest explorations in the land of lisp, i would be gra...
by refrainrence
Mon Mar 17, 2014 10:16 pm
Forum: newLISP in the real world
Topic: FOOP recursive method
Replies: 4
Views: 1182

Re: FOOP recursive method

Both dolist and map get the job done:

Code: Select all

(new Class 'Tag)

(context Tag)
(define (run)
  (println (self 3))
  ;(dolist (el (self 1)) (:run el)))
  (map (curry :run) (self 1)))
(context MAIN)

(set 't1 (Tag '((Tag () 1 "a") (Tag () 2 "b") (Tag () 3 "c")) 4 "d"))
(:run t1)

(exit)
by refrainrence
Mon Mar 17, 2014 10:07 pm
Forum: newLISP in the real world
Topic: FOOP recursive method
Replies: 4
Views: 1182

Re: FOOP recursive method

I tried to simplify this case further using this code: (new Class 'C) (context C) (define (run) (println (self 2)) (dolist (el (self 1) (:run el)))) (context MAIN) (set 'o1 (C '((C ((C ((C () "sdf")) "zxc")) "qwe")) "asd")) (:run o1) (exit) It seems to run as expected since i removed nested ' (apost...
by refrainrence
Mon Mar 17, 2014 7:46 pm
Forum: newLISP in the real world
Topic: FOOP recursive method
Replies: 4
Views: 1182

FOOP recursive method

Hi, i'm trying to build a tree of objects to represent html markup. I think of a method that will build a string in this way: 1. write the open tag to a string in (self 2) defined directly in fuction 2. run this method for each object in the list of objects in the field (self 1) 3. append (self 2) o...
by refrainrence
Fri Nov 29, 2013 11:46 am
Forum: newLISP Graphics & Sound
Topic: 3D game on windows/linux | OpenGL hardware acceleration
Replies: 6
Views: 4631

Re: 3D game on windows/linux | OpenGL hardware acceleration

Thanks Ted for support. I insist that Newlisp is a part of my project, and i'm sure it will pay off in some time. Meanwhile, creating windows with OpenGL context turned out to be tricky using shared libraries under windows. I'm still not much closer to be an expert in this subject, so not much more ...
by refrainrence
Sat Nov 16, 2013 3:35 am
Forum: newLISP Graphics & Sound
Topic: 3D game on windows/linux | OpenGL hardware acceleration
Replies: 6
Views: 4631

Re: 3D game on windows/linux | OpenGL hardware acceleration

@Astrobe Thanks for the reply. Rather i will find me another project than continue with the game without newlisp. The goal is to use LISP-like language ( because typing 'for (..) {;;;}' by my own will in the spare time gives me a headache). At least this is what i think atm. So what happened next on...
by refrainrence
Sun Nov 10, 2013 5:53 am
Forum: newLISP Graphics & Sound
Topic: 3D game on windows/linux | OpenGL hardware acceleration
Replies: 6
Views: 4631

Re: 3D game on windows/linux | OpenGL hardware acceleration

I only figured out that importing 64 bit dll into 32 bit newlisp won't work ( at least i hope i'm right about it :-P ) yet. I gave up on glut to glfw library instead. I tried to translate this sample: http://www.glfw.org/documentation.html into newlisp: (import "glfw3.dll" "glfwCreateWindow") (impor...
by refrainrence
Fri Nov 08, 2013 5:54 pm
Forum: newLISP Graphics & Sound
Topic: 3D game on windows/linux | OpenGL hardware acceleration
Replies: 6
Views: 4631

3D game on windows/linux | OpenGL hardware acceleration

I want to create a not too sophisticated but a real, playable 3D game in newlisp to run on win7 and linux. I cannot get past firing up the teapot demo found here: http://www.newlisp.org/syntax.cgi?downloads/OpenGL/opengl-demo-ffi-lsp.txt . (println (get-string (glGetString (| GL_VENDOR GL_RENDERER))...
by refrainrence
Fri Aug 09, 2013 4:53 pm
Forum: newLISP in the real world
Topic: FOOP colon method invocation from string
Replies: 8
Views: 1388

Re: FOOP colon method invocation from string

Thanks hilti, thanks cormullion for objective-newlisp link, i think i may need circular links and deep nested access. I will try to write some lines using objective-newlisp later. But before that, i'm going to do some FOOP scripting. I managed to write a possible solution: (define (Circle:Circle x y...
by refrainrence
Thu Aug 08, 2013 10:28 pm
Forum: newLISP in the real world
Topic: FOOP colon method invocation from string
Replies: 8
Views: 1388

FOOP colon method invocation from string

Hi there, i play with newLISP from time to time because writing code in 'real world' languages feels like merry go round. So to avoid a lapse of reason i'm playing atm with my imaginary programming task which goes : Take list of method names stored in list of strings ( or symbols - i'm an ignorant n...