08.02.2015 Views

Programação Funcional e Concorrente com Scheme

Programação Funcional e Concorrente com Scheme

Programação Funcional e Concorrente com Scheme

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

notas de aula -<br />

Jerônimo C. Pellegrini<br />

( result ""))<br />

(if ( null points )<br />

result<br />

( next-point ( cddr points )<br />

( string-append result<br />

( car points ) ","<br />

( cadr points ) " " ))))))<br />

(list-of-points 23 25 10 20 50 60)<br />

”23,25 10,20 50,60 ”<br />

Finalmente, o procedimento make-svg-triangle recebe três pontos, cores para borda<br />

e interior, a largura da borda e retorna a representação do triângulo.<br />

( define make-svg-triangle<br />

( lambda (x1 y1<br />

x2 y2<br />

x3 y3<br />

stroke fill stroke-width )<br />

( cons ’ polygon<br />

( make-attr-list ’fill fill<br />

’stroke<br />

stroke<br />

’ stroke-width stroke-width<br />

’points ( list-of-points x1 y1<br />

x2 y2<br />

x3 y3 )))))<br />

( make-svg-triangle 10 20<br />

100 200<br />

1000 2000<br />

" red " " blue " 4)<br />

Versão Preliminar<br />

(polygon fill ”blue”<br />

stroke ”red”<br />

stroke-width ”4”<br />

points ”10,20 100,200 1000,2000 ”)<br />

Uma imagem SVG é uma tag XML svg, <strong>com</strong> atributos version e xmlns, contendo as<br />

tags que descrevem figuras em seu interior.<br />

74<br />

[ 27 de outubro de 2010 at 15:47 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!