FSDN: ˇ FSF ˇ FSF Europe ˇ SweetCode ˇ Savannah
[GNU-Friends] Sections: Front Page ˇ News ˇ Interviews ˇ GNU-Friends ˇ Diaries
Menu: About ˇ Submit Story ˇ FAQ ˇ Donate ˇ Search
This page brought to you by: Jonas Öberg, just another GNU friend.
Do you use Guile?
By kholmes, Section Diaries
Posted on Wed Jun 19th, 2002 at 19:34:04 GMT
Do you use Guile? I've always been interested in Lisp since scheme is standard on GNU/Linux systems, I've been toying with it. But I've never gotten far with it...

 

Just recently I downloaded the guile manuals (in info, of course) on my system and I'm starting to make some progress. Before, I basically printed out the R5RS specification for scheme--its short enough to print out but many of the core functions in scheme are rather difficult to grok. I've stayed clear of continuations for now until I get a nice tutorial. But basic things I did in basic are rather difficult to do in scheme, it seems. Such as this algorithm. 1.Create random number r. 2.Ask the user for a guess g. 3.If r < g then display "Too high" 4.If r > g then display "Too low" 5.Otherwise, display "You win." and replace r with a new random number 6.Goto 2 The problem I am having with scheme is that it doesn't seem to have a goto statement :) and the do construct is a strange beast--again, I'll probably need a tutorial rather than the specification. Sounds like a job for Google.
< What's Gnu: RMS on UnitedLinux, Free Software in the Enterprise (0 comments) | Greplaw opens today (0 comments) >
Login
Make a new account
Username:
Password:

Poll
Do you use Guile?
Of course, Scheme rules!
Yes, reluctantly--but I prefer languages that aren't parenthetically speaking
No, Bash rules!
No, Perl rules!
No, Python rules!
No. Just no.

Votes: 18
Results | Other Polls

View: Display: Sort:
Do you use Guile? | 7 comments (7 topical, editorial) | Post A Comment
[new] Scheme rules (#1)
by wolfgangj (#341) on Wed Jun 19th, 2002 at 20:19:55 GMT
(User Info)

Hi!

A nice tutorial about continuations is on http://www.eleves.ens.fr:8080/home/madore/computers/callcc.html

And - how should it be different - continuations can be used in a goto-like way. But why don't you just use a labeled let or define a while loop as a macro? :)

Cheers,
GNU/Wolfgang

The GNU Hurd - giving freedom to users!
[ Reply to This ]


 
[new] Comparing languages (#2)
by wolfgangj (#341) on Thu Jun 20th, 2002 at 16:29:36 GMT
(User Info)

Hi!

And BTW, it is weird to compare a LISP-dialect with a language like BASIC, because LISP is intended for using really complex problems. Trivial problems can often be done easier in other languages, because other languages already have the apropriate abstractions. In LISP, you can (and will) build your own abstractions which make it easier to solve the problem at hand. That's why LISP is called a "programmable programming language" and should be used whenever the problem at hand requires abstractions not available anywhere yet. Judging a language by how easy it is to write "hello world" and similar trivial programs is a bad idea.

Cheers,
GNU/Wolfgang

The GNU Hurd - giving freedom to users!
[ Reply to This ]


[new] FIXME: Insert subject line here :P (#4)
by wolfgangj (#341) on Fri Jun 21st, 2002 at 12:36:40 GMT
(User Info)

Hi!

Start with a medium-sized application. :)

Cheers,
GNU/Wolfgang

The GNU Hurd - giving freedom to users!
[ Reply to This ]


 
[new] Guile and multithreading (#5)
by atai (#278) on Mon Jun 24th, 2002 at 19:58:02 GMT
(User Info)

One thing badly needed for Guile as a powerful extension language is good multithreading support. This is a must for multithreaded programs. How is Guile doing on this?

[ Reply to This ]


 
[new] how about this? (#6)
by a member of the hurd (#-1) on Fri Jun 28th, 2002 at 20:42:26 GMT

(define guessing
(lambda (r)

(define get-guess
(lambda()
   (format #t "input guess: ")
   (read)))

(let next ((g (get-guess)))

(cond
((= g r) (format #t "You win. Try again... ")
    (guessing (random 100)))
((> g r) (format #t "Too high. ")
    (next (get-guess)))
(else
   (format #t "Too low. ")
   (next (get-guess)))))))


; activate using (guessing (random 100))

GNU/Paul_E (proud to be a member of the Hurd...)




[ Reply to This ]


Do you use Guile? | 7 comments (7 topical, editorial) | Post A Comment
View: Display: Sort:

Verbatim copying and distribution of this article is permitted in any medium, provided this notice is preserved. Images of gnu:s in the logo are © Free Software Foundation, Inc and distributed under the GNU General Public License. Comments are copyright by thir respective owner. All other material are © 2002 .