caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: [Caml-list] Why do I get a syntax error?
       [not found] <a02vg7$qf2$1@qrnik.zagroda>
@ 2001-12-23 15:47 ` Marcin 'Qrczak' Kowalczyk
  2001-12-23 20:58   ` Johann Spies
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin 'Qrczak' Kowalczyk @ 2001-12-23 15:47 UTC (permalink / raw)
  To: caml-list

Sat, 22 Dec 2001 23:43:33 +0200, Johann Spies <jhspies@adept.co.za> pisze:

>                 let lz = List.append lm [{naam=n;lengte=lg}];
>                   veranderde_lys t lz
> ---------------------------------------------------------

There is no 'in' corresponding to this 'let'.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^
QRCZAK

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] Why do I get a syntax error?
  2001-12-23 15:47 ` [Caml-list] Why do I get a syntax error? Marcin 'Qrczak' Kowalczyk
@ 2001-12-23 20:58   ` Johann Spies
  0 siblings, 0 replies; 3+ messages in thread
From: Johann Spies @ 2001-12-23 20:58 UTC (permalink / raw)
  To: caml-list

On Sun, Dec 23, 2001 at 03:47:21PM +0000, Marcin 'Qrczak' Kowalczyk wrote:
> Sat, 22 Dec 2001 23:43:33 +0200, Johann Spies <jhspies@adept.co.za> pisze:
> 
> >                 let lz = List.append lm [{naam=n;lengte=lg}];
> >                   veranderde_lys t lz
> > ---------------------------------------------------------
> 
> There is no 'in' corresponding to this 'let'.

Thanks everybody who responded and helped me to understand ocaml
a little bit better.  

Have a blessed Christmas.

Johann
-- 
J.H. Spies - Tel. 021-982 2694 / 082 782 0336 / 021-808 4036(w)  
             Posbus 4668, Tygervallei 7536
     "And we know that all things work together for good to 
      them that love God, to them who are the called  
      according to his purpose."            
                                   Romans 8:28
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Caml-list] Why do I get a syntax error?
@ 2001-12-22 21:43 Johann Spies
  0 siblings, 0 replies; 3+ messages in thread
From: Johann Spies @ 2001-12-22 21:43 UTC (permalink / raw)
  To: caml-list

I want to write a function which I can use to determine the
maximum length of a field in a database query so I want to build
a list of fieldnames and their lengths.  

I found it a lot more difficult to build such a list
than would be the case in python which I know better.

I am trying to figure out how ocaml would handle this but got
stuck with the following code. The compiler complains about a
syntax error in the line after the last line of code.
I apologize if it a stupid question, but I can not figure out
why.

-------------------------------------------------------------
let lys1 = ["a";"b";"c"]

type rek = { naam : string; lengte : int }

let rec bourekordlys lys nuwelys = 
  match lys with 
      [] -> nuwelys
    | h::t -> let rekord = {naam = h; lengte = 0}  in
              let l = List.append nuwelys [rekord] in 
              bourekordlys t l;;
   
let l = [];;

let ll = bourekordlys lys1 l in
  let lm = [] in
  let rec veranderde_lys ll lm =  
    match ll with   
      [] -> lm
     | h::t ->  let n = h.naam in 
                let lg = h.lengte + 5 in 
                let lz = List.append lm [{naam=n;lengte=lg}];
                  veranderde_lys t lz
---------------------------------------------------------

What is wrong here?

Johann
-- 
J.H. Spies - Tel. 021-982 2694 / 082 782 0336 / 021-808 4036(w)  
             Posbus 4668, Tygervallei 7536
     "And we know that all things work together for good to 
      them that love God, to them who are the called  
      according to his purpose."            
                                   Romans 8:28 
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-24  6:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <a02vg7$qf2$1@qrnik.zagroda>
2001-12-23 15:47 ` [Caml-list] Why do I get a syntax error? Marcin 'Qrczak' Kowalczyk
2001-12-23 20:58   ` Johann Spies
2001-12-22 21:43 Johann Spies

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).