Read this article from Knuth, "Structured programming with go to statements"
Wednesday, March 19, 2008
Friday, March 14, 2008
Homework: Implement a CFG
You can watch the video detailing the assignment here:
http://www.girsology.com/proglang/
And as soon as Revver approves the video, I will embed the video in this post as well.
Update: Here it is:
Posted by
joshwaxman
at
11:24 AM
0
comments
 
Wednesday, March 05, 2008
class notes for today
type
colors ( red, blue, green, yellow, orage, white, black);
colorset = set of colors;
var
set1, set2 : colorset;
set1 := [ red, blue, yellow ];
set2 := set1;
set2 := [black, blue ];
if (ch = 'c' or ch = 'r' or ch = 'y')
if (ch in ['c', 'r', 'y'])
if (c in colorset)
as bitset
['a' ... 'p']
foo()
{
 int * p, *y;
 p = &f;
 p = y;
cout *p;
cout  p;
p = y;
*p = *y;
p =: y;
p =: f;
int * p = new int [100];
p = new int [100];
*(p + 7);
p[7];
cout  7[p];
*(7 + p);
int &r = t;
r
*r
}
Tombstone
lock and key
int *y;
foo()
{
Int *p;
p = new int;
y = p;
}
eager approach
lazy approach
refernce counting
garbage collection
Posted by
joshwaxman
at
7:46 PM
0
comments
 
The Three-Register Garbage Recycler, or Nodes for Free, by David Wise
"The Three-Register Garbage Recycler, or Nodes for Free," by David Wise. Use the links to the image.
Questions to follow, or perhaps I will ask someone to present.
Posted by
joshwaxman
at
1:06 PM
0
comments
 
Read this paper on Distributed Cyclic Reference Counting
Read this paper on "Distributed Cyclic Reference Counting" by    Frank Dehne, Rafael D. Lins.
Questions on the paper to follow. Or perhaps I will ask someone to summarize the paper.
Posted by
joshwaxman
at
12:58 PM
0
comments
 
Monday, March 03, 2008
Some class notes
1 4 6 8 5 32 0 -1
1 4 6 8 5 3 2 0 -1
1 8 2 4 5 0 6 3 -1
int list[10];cout list[k];
address(list[k]) = address(list[1]) + (k-lowerbound)*el_size= address(list[1])- lowerbound*el_size + k*el_size
descriptor for arrays_________arrayelem typeindex type# of dimensionsindex upper boundindex lower boundaddress
// using ] in place of greater than because of html%salaries = ("Cedric" =] 75000, "Perry" =]56000);$salaries{"Perry"} = 70000;$s = "Josh";$salaries{$s} = 8000;if exists $salaries{"Shelly"}delete $salaries{"Perry"};%salaries = ();
01 EMPLOYEE-RECORD 02 EMPLOYEE-NAME  05 FIRST  PICTURE IS X(20)  05 MID  PICTURE IS X(20)  05 LAST  PICTURE IS X(20) 02 HOURLY-RATE  PICTURE IS 99V99
01 employer-record 02 employer-name  05 FIRST  PICTURE IS X(20)  05 LAST  PICTURE IS X(20)  05 SSN  PICTURE IS X(20)
FIRST OF EMPLOYEE-NAME OF EMPLOYEE-RECORD
FIRST OF EMPLOYEE-RECORD
STRUCT A{ STRUCT B {  INT X;  INT Y; } J; CHAR Z; } H;
H.J.X
class a{ int i; char * p; string g; a() { p = new char [60]; ~a() { delete [] p; }};
a b, c;
b = c;
b.g = c.g;
move corresponding employer-record to employee-record
dynamic variables as discussed in the papermain(){ int x, y; int z; set z : int = x -4 in {  foo();   bar(); } bar();}
foo(){ int a, b; use z : int in {  cout  z;
 }}
bar(){ int q; set z : int = q -4 in {  foo();  }}
Posted by
joshwaxman
at
2:41 PM
0
comments
