<< Back to previous view

[LOGIC-134] Historic artifacts in the implementation of Choice prevent take* from being generally usable. Created: 07/May/13  Updated: 28/Jul/13  Resolved: 07/May/13

Status: Closed
Project: core.logic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Austin Haas Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None

Attachments: File LOGIC-134-fix.diff    
Patch: Code


The implementation of Choice is slightly broken, because in certain contexts it is assumed that the first value in the Choice stream will be wrapped in a list. I believe this is a historical artifact; maybe the list wrapper was used to differentiate two types of values, as in the case of distinguishing not-found from nil.

This defect prevents take* from being used generally, since the current implementation of take* for Choice assumes the first value is wrapped in a list, which is not the case for Choice streams during the search.

Patch to follow.

Comment by Austin Haas [ 07/May/13 3:23 PM ]

Never wrap first item to Choice in a list. Fixes LOGIC-134.


Comment by David Nolen [ 07/May/13 10:27 PM ]

The attached patch does not work, many tests fail.

Comment by David Nolen [ 07/May/13 11:37 PM ]

fixed, http://github.com/clojure/core.logic/commit/0a8b619880c7cbea4cf8e9a280cbd5bdb413a12c

Generated at Fri Jan 19 21:43:01 CST 2018 using JIRA 4.4#649-r158309.