[Nemerle 0001038]: returning tuple from block cases error

1 view
Skip to first unread message

feed...@nemerle.org

unread,
Dec 10, 2008, 3:23:00 AM12/10/08
to nemerl...@googlegroups.com

A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=1038>
======================================================================
Reported By: Denis
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 1038
Category: Compiler (type engine)
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 08-09-2007 11:57 CEST
Last Modified: 12-10-2008 09:22 CET
======================================================================
Summary: returning tuple from block cases error
Description:
this code produces error in latest compiler
========================
def (_a, _b) = result:
{
result((1, 2))
}
=========================
bug.n:3:5:3:11: error: goto (block return?) is not allowed inside
expressions

======================================================================

----------------------------------------------------------------------
Denis - 08-09-07 11:59
----------------------------------------------------------------------
Added to wrong category

----------------------------------------------------------------------
divan - 10-19-07 18:46
----------------------------------------------------------------------
It's not returning tuple but decomposing it to _a and _b
Code is transformed to match("block")

Workaround is of course to
def _ab = "block";
def (_a, _b) = _ab;

----------------------------------------------------------------------
divan - 12-10-08 09:22
----------------------------------------------------------------------
Also
mutable (_a, _b) = result: {
result ((1, 2))
}

isn't handled, along with others complex patterns.

Issue History
Date Modified Username Field Change
======================================================================
08-09-07 11:57 Denis New Issue
08-09-07 11:59 Denis Note Added: 0001940
08-09-07 19:29 divan Category Code Completion Engine =>
Compiler (type engine)
08-09-07 19:29 divan Description Updated
10-15-07 19:23 divan Issue Monitored: divan
10-19-07 18:46 divan Note Added: 0001969
12-10-08 09:22 divan Note Added: 0002149
======================================================================

feed...@nemerle.org

unread,
Dec 10, 2008, 3:54:32 AM12/10/08
to nemerl...@googlegroups.com

A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=1038>
======================================================================
Reported By: Denis
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 1038
Category: Compiler (type engine)
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 08-09-2007 11:57 CEST
Last Modified: 12-10-2008 09:54 CET

======================================================================

----------------------------------------------------------------------
VladD2 - 12-10-08 09:54
----------------------------------------------------------------------
I think that the block should be ended by value return. Try use:


mutable (_a, _b) = result: {

(1, 2)
}

Issue History
Date Modified Username Field Change
======================================================================
08-09-07 11:57 Denis New Issue
08-09-07 11:59 Denis Note Added: 0001940
08-09-07 19:29 divan Category Code Completion Engine =>
Compiler (type engine)
08-09-07 19:29 divan Description Updated
10-15-07 19:23 divan Issue Monitored: divan
10-19-07 18:46 divan Note Added: 0001969
12-10-08 09:22 divan Note Added: 0002149

12-10-08 09:54 VladD2 Note Added: 0002150
======================================================================

feed...@nemerle.org

unread,
Dec 10, 2008, 5:20:24 AM12/10/08
to nemerl...@googlegroups.com

A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=1038>
======================================================================
Reported By: Denis
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 1038
Category: Compiler (type engine)
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 08-09-2007 11:57 CEST
Last Modified: 12-10-2008 11:20 CET

======================================================================

----------------------------------------------------------------------
divan - 12-10-08 11:20
----------------------------------------------------------------------
It doesn't matter, DefMutable doesn't work with patterns now, and works
with tuple pattern in very limited way. I think that if "def
some_tuple=..." is valid then "mutable some_tuple=..." should be valid
too.

Issue History
Date Modified Username Field Change
======================================================================
08-09-07 11:57 Denis New Issue
08-09-07 11:59 Denis Note Added: 0001940
08-09-07 19:29 divan Category Code Completion Engine =>
Compiler (type engine)
08-09-07 19:29 divan Description Updated
10-15-07 19:23 divan Issue Monitored: divan
10-19-07 18:46 divan Note Added: 0001969
12-10-08 09:22 divan Note Added: 0002149
12-10-08 09:54 VladD2 Note Added: 0002150

12-10-08 11:20 divan Note Added: 0002151
======================================================================

Reply all
Reply to author
Forward
0 new messages