4 ms·
1) Improper list, or a cons cell. Quote and dotted pair notation are pretty common "in the wild". http://download.plt-scheme.org/doc/html/guide/Pairs__Lists__
by GregBuchholz 9y ago
1) Improper list, or a cons cell. Quote and dotted pair notation are pretty common "in the wild".
http://download.plt-scheme.org/doc/html/guide/Pairs__Lists__and_Scheme_Syntax.html http://download.plt-scheme.org/doc/html/guide/Pairs__Lists__...
2) Yup, complex number.
3) Another improper list.
4) Imaginary number in polar coordinate notation
5) # at the end of a numbers are to express inexactness, and are equivalent to a zero digit, so that express is 100.
6) The first one in that list (#i+1) is actually just 1.0, no imaginary part. The #i notation is for inexact numbers. The other two are the complex numbers i and 1+i.
http://www.delorie.com/gnu/docs/guile/r5rs_54.html http://www.delorie.com/gnu/docs/guile/r5rs_54.html
7) Yes, an exact complex number. Interestingly enough, Dr. Racket in R5RS mode accepts that just fine, but Guile doesn't seem to like it.
8,9) Yes.
For the full syntax of scheme see:
http://www.scheme.com/tspl2d/grammar.html http://www.scheme.com/tspl2d/grammar.html
- didibus 9y agoWell, I've learned some things. I'm still confused about '(1. . #\#) So it's a pair containing 1.0 and pound? It's the 1. I find surprising. You can omit the number after the dot? Oh, and what's improper about `(1 ,@2) ? Wouldn't it evaluate to (1 2) ?
- GregBuchholz 9y agoIn "'(1. . #\#)" the "1." is a number. You are correct that you don't need digits after the decimal point. And #\# is just the pound character. `(1 ,2) is a proper list, and `(1 ,@2) is an improper list. You'll want to check out unquote-splicing: http://www.cs.rpi.edu/academics/courses/fall00/ai/scheme/reference/schintro-v14/schintro_129.html#SEC182 http://www.cs.rpi.edu/academics/courses/fall00/ai/scheme/ref...