chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] new syntax extensions...


From: Elf
Subject: [Chicken-hackers] new syntax extensions...
Date: Wed, 23 Jan 2008 05:55:27 -0800 (PST)


Hi all,

SVN head now has a few new tricks to aid debugging.

Special reader syntax added:

##current-file
    returns the current filename, ie, the port name for whatever
    file/socket/etc is currently being read.

##current-line
    returns the line number that the statement appears on.

example:

testfile1.scm:
(display (conc "got here: " ##current-file " " ##current-line "\n"))
(define foo 3)
(define bar 4)
(display (conc "got here: " ##current-file " " ##current-line "\n"))

testfile2.scm:
(display (conc "got here: " ##current-file " " ##current-line "\n"))
(load "testfile1.scm")
(display (conc "got here: " ##current-file " " ##current-line "\n"))


csi# (load "testfile2.scm")
got here: testfile2.scm 1
got here: testfile1.scm 1
got here: testfile1.scm 4
got here: testfile2.scm 3


next addition, condition-case now takes in an optional else clause of the form:
(else <lambda-list> <body>...)

if no condition/error is signalled, this binds the value(s) of the test clause
to the var/list of var(s) in <lambda-list> and executes <body>... in that context. this should (hopefully!) make life a bit easier for handling cases
where one wants to catch errors and continue without designating some arbitrary
value as 'condition caught' to prevent some set of statements from executing.


hope this helps!

-elf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]