Liquidsoap
  1. Liquidsoap
  2. LS-592

Add support for extensible records

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      We should add objects in Liquidsoap in order to justify the "dot" notation, and a first step in this direction would be to add (extensible) records.

        Activity

        Hide
        Samuel Mimram
        added a comment -
        This is fixed, I now don't have anymore open bug concerning records.
        Show
        Samuel Mimram
        added a comment - This is fixed, I now don't have anymore open bug concerning records.
        Hide
        Samuel Mimram
        added a comment -
        Concerning the datastructure for fields, I was not so much concerned about performances but code simplicity. Due to the current uses of Liq I don't think that this really matters, but feel free to use maps if you prefer :)
        Show
        Samuel Mimram
        added a comment - Concerning the datastructure for fields, I was not so much concerned about performances but code simplicity. Due to the current uses of Liq I don't think that this really matters, but feel free to use maps if you prefer :)
        Hide
        Samuel Mimram
        added a comment -
        Ah yes, one last thing:

        # list;;
        - : [length: ∀'a 'b 'a 'a 'a 'a 'a 'a 'i 'a 'i 'a 'a . ((['a])->int),
             mem: ∀'a 'b 'a 'a 'a 'a 'a 'a 'i 'a 'i 'a 'a . (('b,['b])->bool),
             rev: ∀'a 'b 'a 'a 'a 'a 'a 'a 'i 'a 'i 'a 'a . ((['a])->['a]),
             ...

        I don't think that it comes from my code but from the generalized variables associated to builtins. Anyway, it's not incorrect (just very unnecessary...).
        Show
        Samuel Mimram
        added a comment - Ah yes, one last thing: # list;; - : [length: ∀'a 'b 'a 'a 'a 'a 'a 'a 'i 'a 'i 'a 'a . ((['a])->int),      mem: ∀'a 'b 'a 'a 'a 'a 'a 'a 'i 'a 'i 'a 'a . (('b,['b])->bool),      rev: ∀'a 'b 'a 'a 'a 'a 'a 'a 'i 'a 'i 'a 'a . ((['a])->['a]),      ... I don't think that it comes from my code but from the generalized variables associated to builtins. Anyway, it's not incorrect (just very unnecessary...).
        Hide
        Samuel Mimram
        added a comment -
        Actually, the last bug is also corrected now. The only left issue is that constraints are not well displayed for records (they should be displayed in the fields after the universal quantification, but I don't really have the motivation for this small thing right now.... Otherwise it works as expected.
        Show
        Samuel Mimram
        added a comment - Actually, the last bug is also corrected now. The only left issue is that constraints are not well displayed for records (they should be displayed in the fields after the universal quantification, but I don't really have the motivation for this small thing right now.... Otherwise it works as expected.
        Hide
        Samuel Mimram
        added a comment -
        Apparently my hack for record definition really has to be fixed:

        list = [ list with f = fun(~x=list.hd) -> ()]

        works without any problem but

        def list.f(~x=list.hd) = () end

        results in

        Fatal error: exception Not_found
        Raised at file "list.ml", line 144, characters 16-25
        Called from file "lang/lang_values.ml", line 1055, characters 24-42
        Called from file "lang/lang_values.ml", line 1091, characters 22-35
        Called from file "tools/utils.ml", line 25, characters 51-56
        Called from file "lang/lang_values.ml", line 1168, characters 44-67
        Called from file "list.ml", line 57, characters 20-23
        Called from file "lang/lang_values.ml", line 1167, characters 12-105
        Called from file "lang/lang_values.ml", line 1123, characters 27-43
        Called from file "lang/lang_values.ml", line 1250, characters 14-20
        Called from file "lang/lang_values.ml", line 1315, characters 18-31
        Called from file "lang/lang.ml", line 671, characters 14-38
        Called from file "tools/tutils.ml", line 85, characters 14-18
        Re-raised at file "tools/tutils.ml", line 85, characters 54-55
        Called from file "lang/lang.ml", line 697, characters 8-12
        Re-raised at file "lang/lang.ml", line 802, characters 49-50
        Called from file "lang/lang.ml", line 815, characters 8-242
        Called from file "lang/lang.ml", line 825, characters 4-76
        Called from file "main.ml", line 108, characters 34-40
        Called from file "main.ml", line 557, characters 2-29
        Show
        Samuel Mimram
        added a comment - Apparently my hack for record definition really has to be fixed: list = [ list with f = fun(~x=list.hd) -> ()] works without any problem but def list.f(~x=list.hd) = () end results in Fatal error: exception Not_found Raised at file "list.ml", line 144, characters 16-25 Called from file "lang/lang_values.ml", line 1055, characters 24-42 Called from file "lang/lang_values.ml", line 1091, characters 22-35 Called from file "tools/utils.ml", line 25, characters 51-56 Called from file "lang/lang_values.ml", line 1168, characters 44-67 Called from file "list.ml", line 57, characters 20-23 Called from file "lang/lang_values.ml", line 1167, characters 12-105 Called from file "lang/lang_values.ml", line 1123, characters 27-43 Called from file "lang/lang_values.ml", line 1250, characters 14-20 Called from file "lang/lang_values.ml", line 1315, characters 18-31 Called from file "lang/lang.ml", line 671, characters 14-38 Called from file "tools/tutils.ml", line 85, characters 14-18 Re-raised at file "tools/tutils.ml", line 85, characters 54-55 Called from file "lang/lang.ml", line 697, characters 8-12 Re-raised at file "lang/lang.ml", line 802, characters 49-50 Called from file "lang/lang.ml", line 815, characters 8-242 Called from file "lang/lang.ml", line 825, characters 4-76 Called from file "main.ml", line 108, characters 34-40 Called from file "main.ml", line 557, characters 2-29

          People

          • Assignee:
            Unassigned
            Reporter:
            Samuel Mimram
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: