Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,149,819 members, 7,806,297 topics. Date: Tuesday, 23 April 2024 at 02:19 PM

Any Lisp/scheme Programmers In Here? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Any Lisp/scheme Programmers In Here? (2962 Views)

Lisp Language / Lisp Failed Because Of Snobbery / Why Doesn't Anyone In Nigeria Code In A Lisp (2) (3) (4)

(1) (2) (Reply) (Go Down)

Any Lisp/scheme Programmers In Here? by DonSegmond(m): 5:59pm On May 22, 2010
Anyone here program in Lisp / Scheme?

Any interests in Artificial Intelligence?
Re: Any Lisp/scheme Programmers In Here? by tomX1(m): 4:44pm On May 24, 2010
Hi @Poster,
More out of sheer curiousity than anything else, I cut my teeth on common lisp over ten years ago.
in all that time, aside from a handfull of guys trying their hands on auto-lisp ( a watered down version
of lisp that runs in autocad) I've not met anyone who mentioned lisp let alone works with it.
So what do you want lisp for bro?
Re: Any Lisp/scheme Programmers In Here? by Seun(m): 6:40pm On May 24, 2010
What about Clojure? I think it may be the most promising modern Lisp.

1 Like

Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 12:41pm On May 26, 2010
I just started learning Scheme.hard to look at syntax but i was made to believe that it is the best programming language (apart from Python) to learn programming cos it has a lot of concepts of abstraction that are not present in a lot of other popular programming languages.

, and i'm interested in AI
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 1:52am On May 28, 2010
@tomX. Common Lisp for anything, I really got bored with computers 7 yrs ago and hated everything about them. Picking up lisp is what makes it exciting again. If not for lisp, I wouldn't even bother writing code. So for full programming, there's tons of libraries. People are developing full fledge applications with it, DB, network, web apps, etc. Anywayz, I'm just toying around with it for now, interested in using it for AI work tho.

@sean, I did checkout clojure, and it's cute. But I hate java so much that I distrust anything that even runs on JVM. smiley Clojure page says clojure is lisp-1, not even 1.5 common lisp is more like lisp-2. If I absolutely must make use of jvm, then perhaps I will look into common lisp, but I write code for myself, and I don't believe in client side apps anymore, so I can stick em to the server, and tons of common lisp compilers generate native code that can be as fast as C code CMUCL and SBCL for instance. (my main picking point with clojure for now. symbols not storage location, no tail call optimization, All (global) Vars can be dynamically rebound without interfering with lexical local bindings.)
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 1:54am On May 28, 2010
tundebabzy.
scheme is a very smaller subset of lisp. It's a good start, if you really want to learn it really good, checkout this book. http://mitpress.mit.edu/sicp/ "Structure and Interpretations of Computer Programs. Argueable the best computer programming book ever written for learning to program if one can make such a bold statement. They use scheme, used for main years to teach at MIT.
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 6:34am On May 28, 2010
@DonSegmond
already have its ebook and been reading it for a while. I also have How to Do Programming which is also a nice one and similar plus videos of MIT's Stucture and Interpretation of Computer Programs course lectures. The syntax is quite funny but i'm enjoying it.
What part of AI are you into or planning to go into?
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 6:09pm On May 28, 2010
@tundebabzy,

the syntax is not funny. don't forget, code is data is code is data.
code is data, data is code.

alot of people love to argue that code can be data, in other languages, but this is not true, once you get the hang of this, you can do amazing things.

for example in C, we might have

int foo (int x, int y) {
return (x + y);
}

which get's called as foo(6, 7);

however note in scheme/lisp we have
(defun foo (x, y) (+ x y))
which get's called as (foo 6 7)
they are both lists, the defun/define also looks like a call to a function

that's where the power of that syntax/parathesis comes into play.

as for which part of AI. lol, no part, but every part.

I'm going after a complete general AI system with common sense reasoning and human level intelligence.
Re: Any Lisp/scheme Programmers In Here? by tomX1(m): 6:50pm On May 28, 2010
@DonSegmond,
The concept of abstraction is inherent in all OOP languages.The thing is how readable is a language like lisp and how proficient is it when it comes to builsding robust apps. Programes that even use lisp as a scripting language are not even built with lisp. as for readability I wouldn't compare
Lisp:
(- (* (+ x y) (/ a b)) c)

with C/C++:
((x+y)*(a/b)) - c;


tundebabzy:

I just started learning Scheme.hard to look at syntax but i was made to believe that it is the best programming language (apart from Python) to learn programming cos it has a lot of concepts of abstraction that are not present in a lot of other popular programming languages.

, and i'm interested in AI
I belive authors of every programming language books always claim their platform is the best. There is a reason why languages like Java, C/C++/C# have achieved the amount of fame they have. Trust me it's not just hype you have to use them profficiently to realy understand. Besides Lisp is not the only ( nor the most proficient) platform for AI (I take it AI as you used it is Artificial Inteligence). How many renowned games or simulators do you know that were developed with lisp?
Re: Any Lisp/scheme Programmers In Here? by iGuru1(m): 7:57pm On May 28, 2010
@all
What are the advantages of lisp to other languages like C,python?
What types of programing is lisp mostly used for?
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 3:48am On May 29, 2010
@tomx
see, i'm not worried about readability, i want programs that can write programs.
i find it amusing when people want to compare lisp's postfix notation with infix notation. you are missing the point.

the point is that (defun foo (x y) (+ x y)) is one a list.
so that code is also data. the interesting thing is that our program can then write programs using macro at runtime, which can get eval and compiled to native code. so our program can write programs and these programs are not interpretted but compiled.

this is something that no other language has. no other language truly has code as data so cleanly. a C++ or java code is "data" to thel compiler and data generated by human for the machine.

the issue of generating code i believe is very important in AI, as an AI system will need to generate new code as it learns to achieve it's goal.

BTW, I will tell you my own opinion of why lisp didn't take off, see lisp is very solid and complicated. before 1990, lisp already was very well established and could even do OOP. but what kind of computer did we have in 1990? most people had 8bit 8086 machines and 16bit 286machines with a few kb of memory It was hard as hell to implement lisp on those machines then, so people implemented basic and pascal and then then C. so in the early 90's, a lot of us who got into personal computing then, had access only to basic, pascal, C, and asm. the only way to get access to lisp was through workstations in the academia environment. with the growth of computing, a lot of early programmers cut their teeth on imperative style of C, so the transition to C++, then Java/C# was much easier. This I believe is the honest reason lisp didn't take over the world. The hardware available to the mass was not easily accessible. However, a lot of languages are now moving towards lisp and getting features that the language has had for over 20+ yrs. python, ruby, scalar, clojure? lispy

In my own humble opinion, lisp is the only language for AI. This will only become clear with complete mastery of the language. Ig talking about true AI, not just some clever brute force algorithm. Talking about games, how man renowned games are written in java and C#? I have done game programming on PC, nintendo gameboy and sony PSX. It was all assembly or C, because every shoots for speed. Plus most dev tools that come are in C. However, naughty dog entertainment the guys that did crash bandicoot on PSX, did it with lisp and their other games.

I won't suggest lisp for everything, however, for AI? one has to be crazy not to. smiley Btw, it's easy to implement a prolog on top of lisp, now try implementing lisp on top of prolog. :-)
Re: Any Lisp/scheme Programmers In Here? by tomX1(m): 12:10pm On May 29, 2010
DonSegmond:

@tomx
see, i'm not worried about readability, i want programs that can write programs.

I've have been doing things like that even with rudimentary Javascript and PHP does it elegantly too. Programs like C++ takes it to a whole new level! To say C++ cannot do this simply saying you are not familiar with the platform. What do you think Your Visual Studio Compiler is built with? Visual C++. Most microsoft products are also built with Visual C++ and they all have macro tools and inbuilt programing interfaces. Many code generators are built with C++ and Java. This is no news.

DonSegmond:

@tomx
see, i'm not worried about readability

In any programing effort that goes beyond rudimentary level, debuging, portability and continuity are issues of big consideration. If your codes are not readable then you will find that it is of little use even to you the developer when you have to debug and / or update it much latter.

DonSegmond:

no other language truly has code as data

When you use a script generator like your visual compilers, web development softwares etc, what are they doing? they are generationg codes in response to the things you do and the choices you make. These softwares were not built with lisp.


DonSegmond:

BTW, I will tell you my own opinion of why lisp didn't take off, see lisp is very solid and complicated. before 1990, lisp already was very well established and could even do OOP. but what kind of computer did we have in 1990? most people had 8bit 8086 machines and 16bit 286machines with a few kb of memory It was hard as hell to implement lisp on those machines then, so people implemented basic and pascal and then then C. so in the early 90's, a lot of us who got into personal computing then, had access only to basic, pascal, C, and asm. the only way to get access to lisp was through workstations in the academia environment.

Not realy true! In the early years access to compilers for almost all kinds of program (FORTRAN, FORMIAN, C, BASIC, COBOL, PASCAL, etc) even the ones you have not heard about where "through workstations in the academia environment" to qoute you. The advent of Personal computing changed the trend and as expected most programmers concentrated their efforts on the platforms that where more robust (stable), more powerful, more elegantly deployable etc. This became the age of C++, VB, Java, PHP Pearl, etal.

True Some people still work on lisp but hell even FORTRAN and COBOL and such likes have newer versions too but their age is past.


DonSegmond:


In my own humble opinion, lisp is the only language for AI.

I trust in the fact that most AI programmers are not stupid. If LISP was a better platform then most of these very smart people would 've been using it. It's lack of popularity is because it is not the best tool for the job. It can do the job but it's not the best , not by a mile.
Re: Any Lisp/scheme Programmers In Here? by smoothben: 12:25pm On May 29, 2010
i love the buccaneer let me be a full member, i love this game
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 6:25pm On May 29, 2010
@tomx
I've have been doing things like that even with rudimentary Javascript and PHP does it elegantly too. Programs like C++ takes it to a whole new level! To say C++ cannot do this simply saying you are not familiar with the platform. What do you think Your Visual Studio Compiler is built with? Visual C++. Most microsoft products are also built with Visual C++ and they all have macro tools and inbuilt programing interfaces. Many code generators are built with C++ and Java. This is no news.

I seriously believe you are missing this point. btw, javascript is lispy. smiley when you are using code generator, it's not your own program! you are still in the development phase. I'm talking about a finished product, doing it's thing, generating code that the same finished program can use.

for example, imagine you have a php/c++ program with 10 functions. can you have that program generate new functions that can be called by those same 10 functions? so the program can grow from say 10 functions from it's initial deployment state to 200 functions? and these functions can be called by other programs? and all this happens just by running the program? so, we can ask the user for a function name and defintion and it becomes part of the program.

in lisp i can easily do something like.

(defmaco make-new-func (func-name, &body body)
`(compile ,func-name '(,@body)))

we can now call it with
(make-new-func 'times3 '(lambda (x) (* x 3)))

and the running program will have a new function called times3 which will be compiled, run at native code and can be called by any lisp program. a simple example of this, is imagine developing a basic calculator program, but we want it to be extensible, so you can define your own math functions. with c/c++/java, you will have to embed another scripting language inside!

this is one of the hardest things to understand about lisp, the moment you can grasp this concept, it will blow your mind wide open. smiley


In any programing effort that goes beyond rudimentary level, debuging, portability and continuity are issues of big consideration. If your codes are not readable then you will find that it is of little use even to you the developer when you have to debug and / or update it much latter.
I'm not worried about readability because lisp programs are very readable to me. It's like any other language, you can write very clean, functional and structured code.
the system provides you with ability to document code
(defun foo ()
"documentation string, blah, blah"
(+ 1 2))

we can use the describe, documentation, apropos functions to find our way around unfamiliar systems. With the usage of packages, one can have clean structured codes. java stole all these ideas from lisp, people love javadocs, but lisp had it first, checkout lisp hyperspec. smiley

Not realy true! In the early years access to compilers for almost all kinds of program (FORTRAN, FORMIAN, C, BASIC, COBOL, PASCAL, etc) even the ones you have not heard about where "through workstations in the academia environment" to qoute you. The advent of Personal computing changed the trend and as expected most programmers concentrated their efforts on the platforms that where more robust (stable), more powerful, more elegantly deployable etc. This became the age of C++, VB, Java, PHP Pearl, etal.

True Some people still work on lisp but hell even FORTRAN and COBOL and such likes have newer versions too but their age is past.
Well, I'm talking about the early 90's. I got into the computer in early 90's. In the early 90's, I had access to basic, pascal, C and assembler on the PC. to get FORTRAN or LISP access, one needed access to workstations. now, we could argue that FORTRAN and COBOL are past their age, and you may be right, because we could easily replace them. FORTRAN could be replaced with C, and COBOL could be replaced with Java. But Lisp is not past it's age but has come of age, because there is nothing to replace it! NOTHING! Any new language that will be worthy of replacing lisp will be simply a newer version of lisp because it must provide everything lisp provides and some more.


I trust in the fact that most AI programmers are not silly. If LISP was a better platform then most of these very smart people would 've been using it. It's lack of popularity is because it is not the best tool for the job. It can do the job but it's not the best , not by a mile.
Most AI programmers are silly. smiley They don't know what the hell they are doing, that's why there has been very little progress in the field. smiley
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 6:50am On May 30, 2010
@Tomx
LISP is still the most suitable language for complex applications and like DonSegmond said earlier, its early implementation was hampered due to its hardware requirements. I am personally attracted to LISP because of its macros which is a program that writes another program which might write another program. Now thats powerful
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 12:29pm On Jun 08, 2010
please help me with this code.It is supposed to be an implementation of lexical scoping

The initial code is this:
(define (sqrt x)
(sqrt-iter 1.0 x))

(define (sqrt-iter guess x)
(if (good-enough? guess x)
guess
(sqrt-iter (improve guess x) x)))

(define (good-enough? guess x)
(< (abs (- (square guess) x)) 0.001))
(define (improve guess x)
(average guess (/ x guess)))

Taking advantage of lexical scoping it should be like this:
(define (sqrt x)
(define (good-enough? guess)
(< (abs (- (square guess) x)) 0.001))
(define (improve guess)
(average guess (/ x guess)))
(define (sqrt-iter guess)
(if (good-enough? guess)
guess
(sqrt-iter (improve guess))))
(sqrt-iter 1.0))
;;and that is exactly what is in the book i am reading.

However, when i run it on DrScheme i get this error:
define: expected only one expression for the function body, but found at least one extra part (referring to where improve is being defined)

The text book i am using is MIT's 'Structure and Interpretation of Computer Programs' so i'm wondering how can this be wrong. I tried changing the mode of my DrScheme to Advanced mode but still the same error(i'm using beginner mode).

Can anyone help me with the problem?
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 12:40pm On Jun 08, 2010
i understand lexical scoping. what i dont understand is why that code didnt work
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 7:10pm On Jun 08, 2010
I don't do scheme, but common lisp, so I just intalled guile, but when I run it, I get error on (square)
is (square) defined in your implementation?
also, (average), does your scheme implementation provide those?

(expt) works for me
so to square 3 (expt 3 2)

so i changed square to expt and i implemented my own average and it works.
So you have it right, the code really works without modification if you have average and square.



guile> (define (sqrt x)
(define (good-enough? guess)
(< (abs (- (expt guess 2) x)) 0.001))
(define (average num1 num2)
(/ (+ num1 num2) 2))
(define (improve guess)
(average guess (/ x guess)))
(define (sqrt-iter guess)
(if (good-enough? guess)
guess
(sqrt-iter (improve guess))))
(sqrt-iter 1.0))
guile> (sqrt 81)
9.00001129879022
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 9:00pm On Jun 08, 2010
@DonSegmond
silly me, you were right. i didnt think towards that angle cos i would have been expecting to see an error like this:

reference to an identifier before its definition: average. Thanks

sorry to bother you again but help me out with this code:
;;A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) ;;+ 2f(n - 2) + 3f(n -3) if n> 3. Write a procedure that computes f by means ;;of a recursive process. Write a procedure that computes f by means of an ;;iterative process.

(define (func-n n)
;; f(1),f(2),f(3),f(4),f(5) are already calculated
(cond
[(< n 3) n]
[(= n 3) 4] ;;pre calculated f(3)
[(= n 4) 11] ;;pre calculated f(4)
[(= n 5) 25] ;;pre calculated f(5)
;; calc will do the calculation from f(6) and above
;; calc consumes
;;*a number n(which is user defined as in f(n),
;;*a number counter (a counter to determine where the program should stop and return,
;;*3 starting numbers to calculate the iteration
[(> n 5) (calc n 5 25 11 4)]))

(define (calc n counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc n (+ counter 1) (step-up n1 n2 n3) n1 n2)))

(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))

I want it written so that i can make use of lexical scoping. You can write it in common LISP, i should be able to understand. i have my own "solution" (it looks right to me) but it didnt work. It gives me the error i mentioned earlier and in this case all the function

just in case its different in common LISP, ";;" starts a comment
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 10:50pm On Jun 08, 2010
Can you post your version making use of lexical scope?
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 10:51pm On Jun 08, 2010
tundebabzy:

@DonSegmond
silly me, you were right. i didnt think towards that angle cos i would have been expecting to see an error like this:

reference to an identifier before its definition: average. Thanks

sorry to bother you again but help me out with this code:
;;A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) ;;+ 2f(n - 2) + 3f(n -3) if n> 3. Write a procedure that computes f by means ;;of a recursive process. Write a procedure that computes f by means of an ;;iterative process.

(define (func-n n)
;; f(1),f(2),f(3),f(4),f(5) are already calculated
  (cond
    [(< n 3) n]
    [(= n 3) 4] ;;pre calculated f(3)
    [(= n 4) 11] ;;pre calculated f(4)
    [(= n 5) 25] ;;pre calculated f(5)
;; calc will do the calculation from f(6) and above
;; calc consumes
;;*a number n(which is user defined as in f(n),
;;*a number counter (a counter to determine where the program should stop and return,
;;*3 starting numbers to calculate the iteration
    [(> n 5) (calc n 5 25 11 4)]))
 
(define (calc n counter n1 n2 n3)
  (if
  (= n (+ counter 1))
  (step-up n1 n2 n3) 
  (calc n (+ counter 1) (step-up n1 n2 n3) n1 n2)))
 
(define (step-up n1 n2 n3)
   (+ n1 (* 2 n2) (* 3 n3)))

I want it written so that i can make use of lexical scoping. You can write it in common LISP, i should be able to understand. i have my own "solution" (it looks right to me) but it didnt work. It gives me the error i mentioned earlier and in this case all the function

just in case its different in common LISP, ";;" starts a comment

hmm for some reason, I'm not seeing this topic in the mainthread, I had to look at your last post to see it. I wonder if it's an issue with nairaland,
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 8:05am On Jun 09, 2010
@DonSegmond:
this is what i think that snippet should look like with lexical scoping:

(define (func-n n)
(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))
(define (calc counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc n (+ counter 1) (step-up n1 n2 n3) n1 n2)))
(cond
[(< n 3) n]
[(= n 3) 4]
[(= n 4) 11]
[(= n 5) 25]
[(> n 5) (calc n 5 25 11 4)]))

Like i said earlier,i don't know if i'm wrong (but DrScheme does think i am wrong). It seems DrScheme does not allow more than one expression when creating a procedure. Is it a LISP thing or I should just start reading the book all over again?
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 8:14am On Jun 09, 2010
oops,
tundebabzy:

@DonSegmond:
this is what i think that snippet should look like with lexical scoping:

(define (func-n n)
(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))
(define (calc counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc n (+ counter 1) (step-up n1 n2 n3) n1 n2)))
(cond
[(< n 3) n]
[(= n 3) 4]
[(= n 4) 11]
[(= n 5) 25]
[(> n 5) (calc n 5 25 11 4)]))

should have been this:
(define (func-n n)
(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))
(define (calc counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc (+ counter 1) (step-up n1 n2 n3) n1 n2)))
(cond
[(< n 3) n]
[(= n 3) 4]
[(= n 4) 11]
[(= n 5) 25]
[(> n 5) (calc 5 25 11 4)]))

n in func-n is now a free variable so i didnt include it in the definition of calc.
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 2:24pm On Jun 09, 2010
Your problem more than anything else is not that of getting the concepts and idea, but that of making simple mistakes and then not debugging.
For cond you had the [ and ] as tags eg [(< n 3) n], I changed those to ( and )

then you defined calc
as (define (calc counter n1 n2 n3) which means, it takes 4 argument, in the one without lexical scope it took 5 since it had to read n.

however when you called, you kept passing it n as well, 5 arguments.
(calc n (+ counter 1) (step-up n1 n2 n3) n1 n2)))
and
((> n 5) (calc n 5 25 11 4))
so I took out that extra n and it worked.




guile>
(define (func-n n)
(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))
(define (calc counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc (+ counter 1) (step-up n1 n2 n3) n1 n2)))
(cond
((< n 3) n)
((= n 3) 4)
((= n 4) 11)
((= n 5) 25)
((> n 5) (calc 5 25 11 4))))
guile> (func-n 6)
59
guile> (func-n 7)
142
guile> (func-n 10)
1892
guile> (func-n 20)
10771211

perhaps the scheme I'm using is giving a much better description of error? In which case, I will suggest you download 2 more different type of scheme interpreters. and run your code on them.

here is an example of the message I got, after fixing the [ and ] in the cond

guile> (func-n 6)

Backtrace:
In standard input:
34: 0* [func-n 6]
In unknown file:
?: 1 (letrec ((step-up #) (calc #)) (cond (# n) (# 4) (# 11) , ))
In standard input:
,
29: 2 [calc 6 5 25 11 4]

standard input:29:14: In procedure calc in expression (calc n 5 , ):
standard input:29:14: Wrong number of arguments to #<procedure calc (counter n1 n2 n3)

It correctly points out that the error is at line 14, then it shows me that it's calling calc with 6 5 25 11 4 (five arguments), then it tells me wrong number of arguments to the calc procedure which is defined with just 4 arguments (counter n1 n2 n3).

So you have the right ideas, it's just silly mistakes and seeing them then debugging em. :-)
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 4:49pm On Jun 09, 2010
actually in DrScheme (now DrRacket- they have changed the name from Scheme to racket), you can use square brackets for cond expressions (i read that in 'How To Do Programming which is PLT-makers of DrScheme's official book plus i have used it in other codes and it worked.

i made the corrections but it still doesnt work. It seems DrScheme just doesn't allow more than one expression in any procedure definition(that's what the error message seems to be saying). I have downloaded DrRacket and i'm going to download MIT's MITScheme then run both codes like you advised. I'll let you know when i do the comparisons.

meanwhile it seems i really have to understand this LISP and its dialects.
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 10:22pm On Jun 09, 2010
@DonSegmond
It worked on MIT Scheme like a charm which means i have to research more about this DrScheme. DrScheme is more user friendly, MIT Scheme (Edwin) is very "linuxish" and actually looks like a real hacker's tool (i don't mean cracker o). Thanks for the help.

Are you now strictly into common LISP?
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 2:25am On Jun 10, 2010
yeah, MIT Scheme is probably keeping to standards.

Yeah, I have been strictly common lisp, this is the first time I'm installing and playing with scheme. But I really want to read through that book "Structures and Interpreations of Computer Programs" so I will probably learn scheme while reading it, but I probably wouldn't use it.
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 7:21am On Jun 10, 2010
nice.
I'm learning Scheme first while learning how to program. After I finish the SICP book, i'll probably move over to Common Lisp. I have to admit, im enjoying this scheme ride. But i'm still gonna learn python and perl.
Will LISP be very good for building an online payment gateway?I think it should since it sort of falls into AI domain (at least the fraud detection part does)
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 5:44pm On Jun 10, 2010
Learn python, don't bother much with perl. smiley
Yeah, there are tools that allows one to use common lisp to develop web application, but I personally wouldn't for now. I have done my web applications in python and php, and I will probably stick to that until I'm much comfortable. If I really need something complex, then I can code it in Lisp and have my python or php code call it. I'm currently working on a php webapp. Yesterday, I needed to generate a bunch of javascript code from some data around 300 lines. I did it with 18 lines of lisp code. :-)
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 7:42pm On Jun 10, 2010
thats cool.i'm curious, do u program for a living? if you do, do you program full time?if you don't program for a living, do you program for fun or to advance hacker culture i.e improve somethings (maybe go on to be a wealthy software giant kinda thing).
I'm asking cos i'm actually an accountant. i read economics by mistake so now i do programming part time with the intent of going full time hacking especially to take opportunity of the many under-utilised internet opportunities in Nigeria,maybe even africa.
also,does knowing how to write efficient algorithms (instead of brute-force-just-get-the-solution methods that my brain always seems to produce) come with experience or just smartness or both cos 18 lines to do 300 lines job is something that has gotten me very jealous. i've been battling with writing lisp code to do exponentiation and the condition is that it should be a logarithmic iteration.today is my second day
Re: Any Lisp/scheme Programmers In Here? by DonSegmond(m): 3:27am On Jun 11, 2010
thats cool.i'm curious, do u program for a living? if you do, do you program full time?if you don't program for a living, do you program for fun or to advance hacker culture i.e improve somethings (maybe go on to be a wealthy software giant kinda thing).
I'm asking cos i'm actually an accountant. i read economics by mistake so now i do programming part time with the intent of going full time hacking especially to take opportunity of the many under-utilised internet opportunities in Nigeria,maybe even africa.
also,does knowing how to write efficient algorithms (instead of brute-force-just-get-the-solution methods that my brain always seems to produce) come with experience or just smartness or both cos 18 lines to do 300 lines job is something that has gotten me very jealous. i've been battling with writing lisp code to do exponentiation and the condition is that it should be a logarithmic iteration.today is my second day

LOL@read economics by mistake. I wish I had studied economics in school! I don't program for a living, I haven't programmed much for fun either, and the hacker culture is dead in my opinion. The only serious project I want to tackle is true AI and that's because no one else is doing, partially motivated by the challenge, the fun and the wealth. Knowing how to write efficient algorithms comes with learning algorithms, if you don't study them, you will never learn some of them or figure them out. Get a book on data structures and algorithms. The cool thing about lisp tho is that it provides alot of those algorithms and data structures to you, so you don't have to reimplement them, you have resizeable arrays, lists, vectores, it's easy to implement queues and a stack, built in hashtables, sort, search. So Common Lisp does a lot for you so you don't have to be a pro.
Re: Any Lisp/scheme Programmers In Here? by tundebabzy: 10:10am On Jun 11, 2010
ok.
i'll still be coming here to get help from you from time to time. The exponentiation problem i was doing was finally solved at around 2.30am today. I had gotten it somewhat right initially but i discarded it because it was running for ever. it turned out that i didnt debug the code well and did the dumb move of trying out another algorithm instead of persisting till i found out the real problem. I learnt a lesson from that though:
"don't abandon the code until you understand why you must abandon it".
I found that the solution to the problem was to put my base case as the first expression in my cond expression or make sure that the other expressions in my cond do not evaluate if they also satisfy the base case condition i.e (and (not <base case expression>wink  <other predicate>. I was so dissappointed with myself when i found out such a tiny mistake took me days to find. but i guess thats where the fun comes from, that eureka moment.

(1) (2) (Reply)

How To Create Any Type Of Application With J2me Sdk / Nigeria Bank Sort Codes And Their Adresses / Learn How To Build A Realtime Chat Application With Django, Rabbitmq And Vue.js

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 114
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.