Giter VIP home page Giter VIP logo

Comments (6)

xpqz avatar xpqz commented on July 23, 2024 1

You're missing the crucial ⎕IO←0. See the first code cell at the top of every chapter. The Indexing chapter intro emphasises this:

But as before, we begin by setting our index origin, extra important as we’re about to discuss indexing.

     ⎕IO0
      I0 99 
      m  3 3(1 2 3)(3 2 1)(4 5 6)(5 3 1)(5 6 8)(7 1 2)(4 3 9)(3 7 6)(4 5 1)
      
      (0 0)(1 2)(2 2)I m────────────────────────┐
│ ┌────┐ ┌────┐ ┌────┐ │
│ │1 2 3│ │7 1 2│ │4 5 1│ │
│ └~────┘ └~────┘ └~────┘ │
└────────────────────────┘

from learnapl.

xpqz avatar xpqz commented on July 23, 2024
      ⎕IO0
      ]DISPLAY m  3 39?9──────┐
────┐│
│0 3 5││
││4 2 1││
││7 6 8││
│└~────┘│
└───────┘
      (0 0m)  ¯1 ¯1 ¯1
      m───────┐
¯1  3  5│
│ 4 ¯1  1│
│ 7  6 ¯1│
└~───────┘

from learnapl.

xpqz avatar xpqz commented on July 23, 2024

⎕IO←0 is used exclusively in the book, reasons for which are explained in the first chapter.

from learnapl.

tyoc213 avatar tyoc213 commented on July 23, 2024

gotcha @xpqz thx, interesting, still didnt get why that was there, maybe skim a lot but could you explain what actually is doing and why it is needed?

For me not being English my first lang, isnt clear why I need to define that (except that doesnt work if I dont do that)... also why it isn't defined in the langauge itself or if there are other ways to define the base index. Or how it is referenecd used by other symbols that are already defined.

I think would be helpful to know why.

Anyway, thanks for the book, still searching more ways to learn about APL, resources seem scarse.

from learnapl.

tyoc213 avatar tyoc213 commented on July 23, 2024

I think I have it now, ⎕IO prints 1 just starting the repl, so setting it as 0 as "normal" programming.

So I guess that is a variable already defined on system, interesting way of APL to allow changing base index I guess.

Still dont know why I can't use IO←0 but must use Quad to set it or display it.

from learnapl.

xpqz avatar xpqz commented on July 23, 2024

from learnapl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.