aboutsummaryrefslogtreecommitdiff
path: root/sucl/dnc.icl
blob: 400c5b2617d7c6f1e39908dc60c19880a565f377 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
implementation module dnc

// $Id$

import graph
import StdEnv

// dnc is like varcontents, but can give a more reasonable error message
// when the contents is used when undefined.
dnc :: (var->.String) !(Graph .sym var) var -> (.Bool,Node .sym var) | == var
dnc makemessage graph var
| fst vc = vc
         = (False,(wrong "symbol",wrong "arguments"))
  where vc = varcontents graph var
        wrong element = abort ("getting "+++element+++" of free variable: "+++makemessage var)