Syntax stuff

From: George <>
Date: Tue, 18 May 1999 00:33:50 -0700

I hope none of you are using the old
define ident(args) { body }
way of defining functions, because it's gone :)

I've also changed the ETree structure which is of concern to anyone who is
mucking around with sources.

Another thing I want ideas on is sets and graphs. I want to support both.

I want to define syntax as follows

<1,2,3,4> would be an ordered list (set, possibly multiset), and would be
indexed by set@(i).

(1,2,3,4) would be the same thing, except (1) is not a list but just "1",
because of this problem I need to allow scalar@(1) I guess to sort of cheat
around the problem

{1,2,3,4} would be an unordered set (no duplicates allowed) and this could
not be indexed with set@(i)

`{1,2,3,4} would be an unordered multiset, and would not be possible to
be indexed with set@(i)

Also I want to add:

`[matrix definition] which would be a "quoted" matrix, one which would not be
expanded, meaning:

`[[1:2:3],[3:4],7] would not expand to a single matrix, but would be a
horizontal vector of two vertical vectors and a scalar

The ` basically means "quote", I don't want to use ' as that is for
transpose, Any other syntax ideas are very welcome!

Another thing that I want to add would be a function definition such as

function f(x) = {<1,2>,<2,2>,<3,6>}

however I don't want to use function for this, since normally if you define
a function the right hand side of the equals is NOT evaluated, and in this
case it should be (so that one can use outside variables. One way to solve
this would be to just have a function for this.

f = case_function({<1,2>,<2,2>,<3,6>})

Any other ideas about this?

Another thing: Graphs:

Graphs are usually defined as follows

g = (V,E)

where V is a set of edge labels (strings or values), and E is a set of
ordered pairs of edges, (which allows digraphs)

so one could do

g = ({1,2,3},{<1,2>,<2,1>,<2,3>,<3,1>})

Nice thing about this is that it's very close to mathematical syntax, the bad
thing about it is that it will be slow for evaluation. One way to solve it
would be to make a graph type such as

graph g = ({1,2,3},{<1,2>,<2,1>,<2,3>,<3,1>})

Which sort of breaks from the tradition of gel being an untyped language
(except for functions of course:) And would add complexity to the engine, but
perhaps it might be necessary. It would also solve the problem that if we
were to actually do some sort of result drawing, we would know when to draw a
graph and when to just write out a set.

Any ideas????


George Lebl <>
  The following implements RSA in perl and is illegal to export from the US:
          #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
          $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
Received on Tue May 18 1999 - 00:33:58 CDT

This archive was generated by hypermail 2.2.0 : Sun Apr 17 2011 - 21:00:02 CDT