Today, however, I'd like to give you a preview of some things to come. Can you imagine a Lisp-like CAS language that also has .NET capabilities? Here at PLANETQUANTUM.COM, we are making it happen. Below is some Quantum 2010 console output, including bits of computer algebra, database, networking, and web interaction.
>(Factorial 100)
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000
>(^ 10 100)
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
>(SetPrecision 300)
300
>(Sin 1.)
.841470984807896506652502321630298999622563060798371065672751709991910404391239668948639744
>(ForEach (x #[[1 2][3 4]]) (Print Console.Out x))
1
2
3
4
NULL
>(Setq request (WebRequest.Create "https://www.planetquantum.com"))
System.Net.HttpWebRequest
>(Setq response (request.GetResponse))
System.Net.HttpWebResponse
>(Setq reader (New StreamReader (response.GetResponseStream)))
System.IO.StreamReader
>(reader.Peek)
60
>(Console.WriteLine (reader.ReadLine))
<!------------------------------------------------------------->
NULL
>(Expand (^ (+ x 1) 5))
(+ 1 (* 5 x) (* 5 (^ x 4)) (* 10 (^ x 2)) (* 10 (^ x 3)) (^ x 5))
>(Setq connectString "Data Source=localhost;Initial Catalog=Test;Integrated Security=True")
"Data Source=localhost;Initial Catalog=Test;Integrated
Security=True"
>(Setq sql "SELECT * FROM [Planets]")
"SELECT * FROM [Planets]"
>(Setq connection (New SqlConnection connectString))
System.Data.SqlClient.SqlConnection
>(connection.Open)
NULL
>(Setq command (New SqlCommand sql connection))
System.Data.SqlClient.SqlCommand
>(Setq reader (command.ExecuteReader))
System.Data.SqlClient.SqlDataReader
>(reader.Read)
TRUE
>(Console.WriteLine "Name={0}, Temp={1}" (Elt reader "Name") (Elt reader "Temp"))
Name=Sun, Temp=9941
NULL
>(reader.Close)
NULL
>(connection.Close)
NULL
>(Setq ping (New Ping))
System.Net.NetworkInformation.Ping
>(Setq options (New PingOptions))
System.Net.NetworkInformation.PingOptions
>(Setq options.DontFragment TRUE)
TRUE
>(Setq string "Quantum")
"Quantum"
>(Setq bytes (Encoding.ASCII.GetBytes string))
[81 117 97 110 116 117 109]
>(Setq timeout 120)
120
>(Setq host "www.planetquantum.com")
"www.planetquantum.com"
>(Setq reply (ping.Send host timeout bytes options))
System.Net.NetworkInformation.PingReply
>reply.RoundtripTime
98
>(Load "~\\Test\\PingTest.q")
"C:\Planet Quantum\Quantum 2010.0\Test\PingTest.q"
>(Pretty Console.Out PingTest)
(Def (PingTest host)
(Local ping options string bytes timeout reply)
(Setq ping (New Ping))
(Setq options (New PingOptions))
(Setq options.DontFragment TRUE)
(Setq string "Quantum")
(Setq bytes (Encoding.ASCII.GetBytes string))
(Setq timeout 120)
(Setq reply (ping.Send host timeout bytes options))
(Cond ((== reply.Status IPStatus.Success)
(Console.WriteLine "Address: {0}" reply.Address.ToString)
(Console.WriteLine "RoundtripTime: {0}" reply.RoundtripTime)
(Console.WriteLine "Time To Live: {0}" reply.Options.Ttl)
(Console.WriteLine "DontFragment: {0}" reply.Options.DontFragment)
(Console.WriteLine "Buffer.Length: {0}" reply.Buffer.Length)))
(Return reply.Status))
NULL
>(PingTest "www.planetquantum.com")
Address: 65.254.231.151
RoundtripTime: 97
Time To Live: 239
DontFragment: True
Buffer.Length: 7
Success
>(HttpUtility.HtmlEncode "<Planet>Quantum</Planet>")
"<Planet>Quantum</Planet>"
>(Setq prime1 (RandomPrime (^ 10 10) (^ 10 11)))
11059457203
>(Setq prime2 (RandomPrime (^ 10 10) (^ 10 11)))
36610742141
>(IFactor (* prime1 prime2))
[1 [[11059457203 1] [36610742141 1]]]
>(* prime1 prime2)
404894935878458091623
>(BesselJ 1. 1.)
.440050585744933515959682203718914913127372301992765251136758171780138222478015547930796592
>(EllipticK .5)
1.685750354812596042871203657799076989500800894141089044119948297893433702882346760406450973
>
TXT Version: 101017.txt. |