I keep having lots of fun with hascheme. In the last couple of
days, I implemented quite a few things. Mostly they are syntax
sugar for things you could already do in HAS, or useful procedures
needed for my basic interpreter testing.
- Perl side
- (define (fun args) body) is now accepted as an alternative way
to declare procedures. - (let) implemented. These bindings for local vars are just sintactic sugar for
what you'd write in perl:
sub { my $a=shift; … }->(initialval)
- (define (fun args) body) is now accepted as an alternative way
- Scheme side
Reread the 'Why functional programming matters' paper, and implemented:- make-counter, foldr
- append, sum-list, length, map . All are specific cases of the previous
- make-counter, foldr
Reading chapter 4 of our MIT beloved book, I saw the next step, making a lazy
interpreter from this Half Assed one.
Ah, the repo
2 comentarios:
Ei! Veig que vas començar a implementar un Scheme... has seguit endavant? Ho vas deixar estar? Jo estic a punt de començar-ne un altre al meu blog per si t'interessa: http://jarnaldich.me.
Iep!
Doncs la veritat és que el vaig deixar en un estat de "mira'm i no em toquis", però la funcionalitat bàsica la tenia, i em va fer entendre la base dels lisps.
Vaig enllaçar-ho amb un motor per fer graphs 3d, i veies el programa executantse visualment. Estava prou bé, però ho vaig deixar en sec.
Gracies per la visita. Seguiré ROPS d'aprop. :)
Publicar un comentario