Ticket #151 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

PANIC in Source.DefixApps ($ do)

Reported by: erikd Owned by: erikd
Priority: blocker Milestone: 0.1.3
Component: Source Desugarer Version: 0.1.2
Keywords: Cc:

Description

Translated Ocaml version of Jensens device:

http://rosettacode.org/wiki/Jensen's_Device

to Disciple as:

-- A mutable Int.
i :: Int %r0 :- Mutable %r0
i = 42 -- initial value doesn't matter
 

sum' i lo hi term
 = do	result = 0.0
	i := lo
	while (i <= hi)
	 $ do	result := result + term ()
		i := i + 1
	result
main ()
 =	println $ show $ sum' i 1 100 (\ () -> 1.0 / toFloat i)

and got:

ddc: PANIC in Source.DefixApps
        makeXDefixApps: parse error at
        ./jensens.ds:13:9   xx = []

Change History

Changed 5 years ago by erikd

  • owner set to erikd
  • status changed from new to assigned
  • summary changed from PANIC in Source.DefixApps to PANIC in Source.DefixApps ($ do)

The problem is actually the '$' followed by 'do':

   while (k < count)
    $ do	result := 2.0 * result

Test is T151-DollarDo?.

Changed 5 years ago by erikd

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in:

Sat Feb 27 13:29:27 EST 2010 Erik de Castro Lopo <erikd@…> Fix #151 : Warn on redundant '$' operator instead of panicing.

Note: See TracTickets for help on using tickets.