aboutsummaryrefslogtreecommitdiffstats
path: root/journal/21jan2009.html
blob: 72ab84bb60f0b7dd5dc0a211d9dd13f47338e88a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>bnewbold thesis</title></head>
<body style="margin: 25px; font-family: helvetica;">
<h1 style="border-bottom: 2px solid;">
Journal: Jan 21, 2009</h1>
<i>Bryan Newbold, <a href="mailto:bnewbold@mit.edu">bnewbold@mit.edu</a></i><br />
<i><a href="http://web.mit.edu/bnewbold/thesis/">
http://web.mit.edu/bnewbold/thesis/</a></i>
<br /><p />
<!-- ================================================================ -->
<!-- ================================================================ -->
Aha! Found the hook needed to disable error interrupt REPLs in mit-scheme:
<pre style="margin:20px; border-left: solid grey 3px; background-color:lightgrey;padding:5px;width:750px;">
(set! standard-error-hook (lambda (x) (begin (warn x) (cmdl-interrupt/abort-top-level))))
</pre>
For example:
<pre style="margin:20px; border-left: solid grey 3px; background-color:lightgrey;padding:5px;width:750px;">
1 ]=&gt; (set! standard-error-hook (lambda (x) (begin (warn x) (cmdl-interrupt/abort-top-level))))

;Value: #f

1 ]=&gt; (car 3)

;Warning: The object 3, passed as the first argument to car, is not the correct type.
;Quit!

1 ]=&gt; 
</pre>
This makes it much easier for sage to do subprocess interactions. I have a 
half-working scm scheme interface and now a half-working mit-scheme interface;
files for both are in the <a href="../other/">other</a> folder. I should have
a demo server running on <a href="http://xvm.mit.edu">SIPB's XVM service</a>
tomorrow, maybe if I polish these interfaces I can package them up as optional
sage .spkgs. Most importantly, for now only put one S-expression in a scheme
notebook cell at a time.
<p />

Of course removing the error REPL loop of course takes away excellent
functionality from the interactive session... to me a vertically split edwin
session with a file *scheme* buffer on the top and REPL output on the bottom is
the best way to "do" scheme.  
<p /> 

In other news I just learned the vim command I was missing: <code>gq}</code>
will rewrap the current paragraph to ~70 columns width; <code>gq</code> will do
the same to the current selection in visual mode. FINALLY.
<hr />
Got mechanics sort of running in sage. Was able to plot and (se ...) from 
within the browser notebook interface which was a... strange experience.
<p />
See <a href="../other/sage-scheme-notes.txt">sage-scheme-notes.txt</a> for 
installation instructions...
<p />
I should either write up a patch or submit a bug/request for a --version
flag for mit-scheme, it needs one!

<p />Todo for scmutils in sage: 
<span style="color:red;">
<ul>
 <li />Handle multiline inputs properly (now echos a lot)
 <li />Handle multiple S-expressions in one notebook cell
 <li />Either basic wrappers or reimplementations for (se ...) and the plotting
 functions so their results will pop up in the notebook
 <li />Interact examples!
 <li />Either drop or finish object wrapping... maybe look through the other
 interface examples more carefully?
 <li />Wrap as an .spkg? Compilation issues on other platforms? Documentation
 and tests?
</ul>

<br /><br />
<a href="19jan2009.html"><i>(previous entry)</i></a>

<!-- ================================================================ -->
<!-- ================================================================ -->
</body>
</html>