[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Visionaries] Yet Another WebScheme update
From: |
Peter Minten |
Subject: |
[Visionaries] Yet Another WebScheme update |
Date: |
Tue, 17 Jun 2003 17:21:57 +0200 |
User-agent: |
Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.4) Gecko/20030529 |
Hi folks,
WebScheme is currently is a very good state, I programmed in it today,
experimenting with some actual coding and it felt really good. I did change a
few things while doing so however:
* The @ sign for metadata is gone. Metadata can now be accessed using obj.meta .
It's possible to add metadata to a class fast using the metadata method:
(define a ;(b)
(metadata
:description "Some method"
:author "Peter Minten")
(\ (b) ...))
The ;(b) is just a convention btw to tell humans that it's a function and what
arguments it accepts. Of course more metadata than just description and author
can be used. The metadata can easily be retrieved using obj.meta, for example:
a.meta.description => "Some method"
* I've replaced the <foo-bar> notation for classes by Foo-Bar. This is because
module.<class>.object looks silly and <module>.<class>.object is a pain to type.
I've decided for CamelCase + binding sign because class and module names should
look like normal field names aside from the capitals and just start
capitalization doesn't look well either.
A few matters have to be solved, but I'm confident that will work :-).
Greetings,
Peter
PS: A small example is attached.
;;Encryption using GPG
(import Base.Crypto.GPG)
;;Base.Crypto.GPG is actually a module, but modules can have methods
((try
(define text
(GPG.encrypt "DotGNU Over The GNU Networking Universe", "Peter Minten")))
(catch
(Base.Crypto.GPG.Bad-Recipient-Exception
(puts "Recipient does not exist: #{system.current-exception.recipient}")
;;"#{foo}" inserts (foo.to String) into the string, kinda like Ruby
;;system.current-exception is the last exception thrown
(puts "Operation aborted"))))
(import Base.Web.Mail.*) ;;include module contents
(send-with-attachments
:to "Peter Minten <address@hidden>"
:subject "DotGNU slogan encrypted"
:attachments '(text)
:priority Mail-Priority.low)
;;Example of using an keyword list
(define send-with-attachments
(metadata
:description "Send a mail with attachments fast and quick, uses keywords"
:author "Peter Minten")
(\ (. args)
(define args (Base.Keyword-Processor.parse args))
(parent.send args["to"] args["subject"] args["from"] args["priority"]
args["attachments"])))
;;Example definition
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Visionaries] Yet Another WebScheme update,
Peter Minten <=