arturo-lang / grafito

Portable, Serverless & Lightweight SQLite-based Graph Database in Arturo
MIT License
138 stars 7 forks source link

Grafito and its samples need updates #48

Open hamidb80 opened 1 month ago

hamidb80 commented 1 month ago

Hey! I've just ran the code and seems like it does not work

══╡ Type Error ╞═════════════════════════════════════════

  Erroneous type found

  Cannot call function:
      function .import: ◄

  Wrong attribute value: 
      true :logical

  Expected: 
      :block

  ┃ File: grafito.art
  ┃ Line: 46
  ┃ 
  ┃   44 ║      dbpath :string :null
  ┃   45 ║      body :block
  ┃   46 ║► ][
  ┃   47 ║      ;; description: « initiate a new graph environment with given name and body
  ┃   48 ║      ;; options: [
hamidb80 commented 1 month ago

when I make it inline like this:

graph: function [dbpath :string :null body :block][

it nags different line:


══╡ Type Error ╞═════════════════════════════════════════════════════════════════════════ <script> ══

  Erroneous type found

  Cannot call function:
      function .import: ◄

  Wrong attribute value: 
      true :logical

  Expected: 
      :block

  ┃ File: grafito.art
  ┃ Line: 1326
  ┃ 
  ┃ 1324 ║      ; and that was it :)
  ┃ 1325 ║      return result
  ┃ 1326 ║► ]
  ┃ 1327 ║  
  ┃ 1328 ║  ;--------------------------
RickBarretto commented 1 month ago

This is because most of our examples are currently deprecated. Basically on sample4.art, this uses do.import, and we don't provide this kind of importing anymore. Now, the right way of doing this is by using the function import.

Well, I'll rename your title to "Samples need to be updated.".

hamidb80 commented 1 month ago

I couldn't find import example in https://arturo-lang.io/documentation/language/ 😥

RickBarretto commented 1 month ago

@hamidb80 this is because import is a new feature, and since we didn't create the new release, the documentation is not fully updated.

If you want to check the import, have a look on:

https://arturo-lang.io/master/documentation/library/core/import/

We've been using this for some time, and this have been very stable to us...

I'll put this update on my TODO list, and fix this very soon.