Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    GiuseppeChillemi
    @GiuseppeChillemi
    In this case, first position in the body of function is a safer place.
    GiuseppeChillemi
    @GiuseppeChillemi
    @greggirwin Do you think we could continue this discussion elsewhere?
    Gregg Irwin
    @greggirwin
    I don't like the func body hack either. Nenad and I talked about it recently. I'm overloaded, but if others want to chat in red/red or elsewhere for fun, I will at least skim things.
    hiiamboris
    @hiiamboris
    @greggirwin this quite surprised me when I used it inside the lexer's trace func:
    >> x: block!
    == block!
    >> ? x
        code             length: 0 index: 24 []
        b                length: 0  []
        p                length: 0 index: 7 []
        e                length: 0 index: 3 []
        included-scripts  length: 26  [%/d/devel/red/common/expect.red %/d/de...
    I understand technically there's no difference between ? x and ? block! but talk about shooting off one's feet..
    Somehow in R2:
    >> x: block!
    == block!
    >> ? block!
    Found these words:
       any-object!     block!    length: 3
       any-path!       block!    length: 3
       bar-effect      block!    length: 4
       base-effect     block!    length: 4
       ctx-edit        block!    length: 152
       ctx-viewtop     block!    length: 371
       datatypes       block!    length: 54
       dtw-keymap      block!    length: 18
       immediate!      block!    length: 17
       internal!       block!    length: 3
       scalar!         block!    length: 7
       suffix-map      block!    length: 25
    
    >> ? x
    No information on x (word has no value)
    the output I don't even understand :)
    why would it have no value..
    Toomas Vooglaid
    @toomasv

    That's what I get in fresh console (Jan 11 build, W10):

    >> x: block!
    == block!
    >> ? x
    No block values were found in the global context.

    And in not so fresh I get looots of blocks:

    >> x: block!
    == block!
    >> ? x
        val              length: 6  [455x1055 15x15 square to-right 0x0 []]
        B1               length: 119 index: 2 [translate 0x0 [push [fill-pen 0.0.0 line-width 1.0 box 0x0 15x1...
        B2               length: 115 index: 6 [translate 15x0 [push [fill-pen white line-width 1.0 box 0x0 15x...
    ...
    hiiamboris
    @hiiamboris
    well I must have had some globally defined blocks
    >> x: block!
    == block!
    >> ? x
    No block values were found in the global context.
    
    >> ? block!
    No block values were found in the global context.
    
    >> b: []
    == []
    >> ? x
        b                length: 0  []
    
    >> ? block!
        b                length: 0  []
    anyway what I wanted to know is what x's value is, not how many blocks there are around :)
    x in this case is the type parameter passed to me by the lexer, and I wanted to know if it passes me words or datatypes (?? is of no help here, nor mold/all)
    Toomas Vooglaid
    @toomasv
    Ah, sorry, my head is a bit hazy now... so, why type? is not good?
    hiiamboris
    @hiiamboris
    it's what I did eventually print [type type? type], but obviously during debugging I'd like to intrude less into the code, so ? was my first try
    gltewalt (The other Greg)
    @gltewalt:matrix.org
    [m]
    Quote it?
    Greg T
    @gltewalt
    >> x: 'block!
    == block!
    >> ? x
    X is a word! value: block!
    
    >> ? (reduce x)
        b                length: 0  []
    hiiamboris
    @hiiamboris
    I don't get to choose what lexer spits at me.
    Greg T
    @gltewalt
    datatype? ?
    gltewalt (The other Greg)
    @gltewalt:matrix.org
    [m]
    That should say yes or no to if it passes you a datatype
    hiiamboris
    @hiiamboris
    you're totally missing the point ☻
    gltewalt (The other Greg)
    @gltewalt:matrix.org
    [m]
    Does not surprise me, but that's what you typed
    hiiamboris
    @hiiamboris
    R3 btw:
    >> x: block!
    == block!
    
    >> ? block!
    BLOCK! is a datatype.
    It is defined as a series of values.
    It is of the general type block.
    
    Found these related words:
      datatypes       block!     length: 57 [end! unset! none! logic! integer! decimal! percent! money! char! pair! tu...
    
    >> ? x
    X is a datatype of value: block!
    there's a great idea there, brilliant even:
    >> ?? ?
    ...
     datatype? :value [
         spec: spec-of :value
         either :word <> to word! :value [
             output ajoin [
                 "^[[1;32m" uppercase mold :word "^[[m is a datatype of value: ^[[32m" mold :value "^[[m^/"
             ]
         ] [
             output ajoin [
                 "^[[1;32m" uppercase mold :word "^[[m is a datatype.^[[m^/"
                 "It is defined as" either find "aeiou" first spec/title [" an "] [" a "] spec/title ".^/"
                 "It is of the general type ^[[1;32m" spec/type "^[[m.^/^/"
             ]
             unless empty? value: dump-obj/match/only system/contexts/lib :word [
                 output ajoin ["Found these related words:^/" value]
             ]
         ]
         throw true
     ]
    mikeyaunish
    @mikeyaunish

    @hiiamboris here is what I get. ```

    x: block!
    == block!
    ?? x
    x: block!
    v: mold x
    == "block!"
    ```

    Gregg Irwin
    @greggirwin

    Here's what I get in R3 (Atronix). You must be using a different one. Maybe @Oldes version based on the escapes in there.

    >> x: block!
    == block!
    
    >> ? x
    x is a datatype
    It is defined as a series of values
    It is of the general type block
    
    No values defined for x
    >> ? block!
    block! is a datatype
    It is defined as a series of values
    It is of the general type block
    
    Found these related words:
       datatypes       block!    length: 58

    So ? x is not helpful there IMO. And this is the key question: What should help do?

    hiiamboris
    @hiiamboris
    do what Oldes' R3 does
    Gregg Irwin
    @greggirwin
    Open a ticket if you want. Can't think deeply about it right now.
    hiiamboris
    @hiiamboris
    done
    Toomas Vooglaid
    @toomasv
    This crashes console on W10:
    x: [a 1] case/all [a: x/a [a] b: x/b [b]]
    hiiamboris
    @hiiamboris
    true
    better report that to Nenad though ;)
    Toomas Vooglaid
    @toomasv
    Another problem with console on W10: generate a view, let it fall behind some other window, close the view without bringing it into foreground first -- console that produced the view hungs.
    hiiamboris
    @hiiamboris
    view [base rate 0:0:3 on-time [unview]] works for me
    oh if I kill it from task manager then hangs
    actually it still works just doesn't print anything
    I can type view [] (enter) and show another window :)
    create an issue
    Toomas Vooglaid
    @toomasv
    This does not correspond to my description. Do this: in console enter view [base]. Click into console. Mouse over console icon in bottom of screen and close the view from there. My console hangs. Does yours?
    hiiamboris
    @hiiamboris
    like I said it doesn't hang
    try inputing ESC view [] ENTER blindly even though it doesn't reflect keystrokes
    menu also works
    Gregg Irwin
    @greggirwin

    Confirmed case/all crash.

    Console hang issue confirmed as well. Scroller itself still moves, but the text area doesn't respond.

    mikeyaunish
    @mikeyaunish

    Checking in on a new behaviour.

    Red 0.6.4 for Windows built 4-Feb-2021/17:06:04-07:00 commit #6440af5
    
    >> foreach i jo [ print [ type? i mold i ]]
    datatype logic!
    datatype percent!
    datatype date!
    datatype file!
    datatype tuple!
    datatype pair!
    datatype string!
    datatype word!
    datatype set-word!
    >> find jo file!
    == [file! tuple! pair! string! word! set-word!]

    Since Feb/2021 build find gives this result:

    >> find jo file!
    == none

    I can work around this. Just checking to see if this is an intentional change?

    Gregg Irwin
    @greggirwin
    This feels like a regression related to /only. You can use find/only for now, but we should check tickets, as there are a couple related to this.
    hiiamboris
    @hiiamboris
    this is september though
    I confirm this is the cause and it was intentional. Now:
    • /only finds file! datatype
    • no-/only - finds any value of file! datatype
    before this PR it was a crazy mix of both
    Gregg Irwin
    @greggirwin
    Thanks @hiiamboris.
    mikeyaunish
    @mikeyaunish
    Great - thanks for clearing that up. The new usage makes sense.